Thank you for your reply! From what I read in the PickerStyle documentation, there is no public API to create a custom one… 🤔
Anyway, revisiting the mentioned sessions allowed me to derive the ID property from the containerValues rather than the Subview.ID, like so:
if let selection = subview.containerValues.tag(for: SelectionValue.self) {
…
}
All I have to do then is tag my custom view in place like so:
ForEach(SomeEnum.allCases, id: \.self) { enumCase in
Text(enumCase.localizedString)
.tag(enumCase)
}
I’m unsure wether this is the best way to go, but at least it technically solves my initial problem and works quite well.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: