Last active
August 30, 2020 00:46
-
-
Save laevandus/84dc55a639b67fd2e0b76859c26b3026 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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