borisovodov / TreePicker

SwiftUI tree picker for selecting options from hierarchical data.
https://swiftpackageindex.com/borisovodov/TreePicker
MIT License
2 stars 0 forks source link

Write in readme about limitations and caveats: refusal of tags #11

Open borisovodov opened 2 months ago

borisovodov commented 2 months ago

In SwiftUI Picker description:

Other examples of when the views in a picker's ForEach need an explicit tag modifier include when you:

  • Select over the cases of an enumeration that conforms to the Identifiable protocol by using anything besides Self as the id parameter type. For example, a string enumeration might use the case's rawValue string as the id. That identifier type doesn't match the selection type, which is the type of the enumeration itself.
  • Use an optional value for the selection input parameter. For that to work, you need to explicitly cast the tag modifier's input as Optional to match. For an example of this, see tag.