Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #520
@supernintendo @carson-katri @shadowfacts Sorry to spam all of you on this. I'm not sure who is the best person for me to ask questions of. Can I get your thoughts on this approach to the Elixir parameters?
This PR is to implement the
scale_effect
modifier, which has two signatures.https://developer.apple.com/documentation/swiftui/view/scaleeffect(_:anchor:)-pmi7
https://developer.apple.com/documentation/swiftui/view/scaleeffect(_:anchor:)-7q7as
I thought we could omit the signature that takes a single param because the version I've implemented that uses
width
andheight
can superseed the single param signature. I saw a similar decision made foraspect_ratio
, even though the Swift version can accept a single float.liveview-client-swiftui/lib/live_view_native_swift_ui/modifiers/aspect_ratio.ex
Lines 1 to 8 in e16e8aa
But for
scale_effect
, I don't think it's very clear to a non-Swift programmer that something calledsize
orCGSize
is actually a width and height scaling ratio. I've always felt that was an awkward Apple contrivance. For someone not familiar with Swift,width
andheight
as individual params seem more obvious and simpler.What are your opinions? Do we want to always map as closely as possible to the SwiftUI function signatures or should we take some liberties that we think will make LVN more broadly understandable?