In iOS 18 and later, an official API has been added to retrieve the tag value, making it easier to implement custom pickers and similar components.
https://developer.apple.com/documentation/swiftui/containervalues/tag(for:)
func tag<V>(for type: V.Type) -> V? where V : Hashable
func hasTag<V>(_ tag: V) -> Bool where V : Hashable