omg, just discovered a new API that seems to have been added (and backported!) in SwiftUI for setting the tag of a view for situations like a tabItem or Picker when the Binding type is Optional, and you're ForEach-ing over non-Optional values.
Instead of having to remember the magick invocation of:
Text(flavour.rawValue).tag(Optional.some(flavour))
you can now just use:
Text(flavour.rawValue).tag(flavour)
https://developer.apple.com/documentation/swiftui/view/tag(_:includeoptional:)/
[#]iosdev #swiftlang #swiftui
=> More informations about this toot | View the thread | More toots from rhysmorgan@mastodon.social
=> View iosdev tag | View swiftlang tag | View swiftui tag This content has been proxied by September (3851b).Proxy Information
text/gemini