Skip to content
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

Merged
merged 4 commits into from
May 30, 2020
Merged

Conversation

andersio
Copy link
Member

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.

@andersio andersio added the enhancement New feature or request label May 18, 2020
@andersio andersio self-assigned this May 18, 2020

public func send(_ event: Event) {
loop.send(event)
}
Copy link
Contributor

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>?

Copy link
Member Author

@andersio andersio May 28, 2020

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 KeyPaths and Event.

Copy link
Contributor

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

Copy link
Contributor

@sergdort sergdort left a 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

@andersio andersio requested a review from sergdort May 28, 2020 14:11
@andersio andersio merged commit 49404fc into develop May 30, 2020
@sergdort sergdort deleted the anders/swiftui branch May 31, 2020 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants