enum Fruit: String, CaseIterable { | |
case apple, orange, pear | |
} | |
func makeFruitPicker() -> some View { | |
Picker("Fruits", selection: $selectedFruit) { | |
ForEach(Fruit.allCases, id: \.rawValue) { fruit in | |
Text(fruit.rawValue).tag(fruit) | |
} | |
}.pickerStyle(SegmentedPickerStyle()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment