-
Notifications
You must be signed in to change notification settings - Fork 11
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
Bookmarks
- Add binding selection
init parameter
#246
Comments
Alternatively, it could be simplified by taking a binding to the selected bookmark as an initializer parameter, giving the caller flexibility to do whatever they want when the selected bookmark is updated ( |
Closing; |
@dfeinzimer Was there any consideration given to taking a binding to the selection? While there is the modifier that you pointed out, taking a binding to the selected bookmark would be simpler and more idiomatic in SwiftUI. Many SwiftUI-provided modifiers take a selection binding instead of providing a separate modifier to inform when the selection has changed. |
Yes - I still think we should do it and I thought we had an issue for it but I'm not seeing it so I'll reopen and re-characterize this issue instead. |
setBookmark(_:)
?Bookmarks
- Add binding selection
init parameter
Some additional API considerations: The current initializers are:
Would we want to add 2 new initializers: brining us to a total of 4? 4 seems like it would be a lot to me. |
The selection parameter should be non-optional because those initializers should only be used with a selection binding. In my opinion, having four initializers isn't a big deal. Several SwiftUI views have much more than four initializers. |
Update:
See discussion below
Original:
As an alternate to using a viewpoint, the bookmarks component can potentially take advantage of the
setBookmark(_:)
method on a map or scene view proxy.The text was updated successfully, but these errors were encountered: