-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@LoopBinding and @EnvironmentLoop for SwiftUI. #11
Conversation
|
||
public func send(_ event: Event) { | ||
loop.send(event) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we extend this to also have binding(for: KeyPath<State, V>, event: Event) -> Binding<V>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is an additive functionality that needs more thoughts, esp conversion/relationship of the KeyPath
s and Event
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well the common use case I guess is showing the sheet
which requires an optional binding that drives presentation of the sheet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks, great!
Got some questions tho
Introduce two property wrappers,
@LoopBinding
and@EnvironmentLoop
, for SwiftUI integration as described in #2.Two simple stepper examples are added to validate the concepts. They shall be replaced with more elaborate examples.