How to use Picker with enum in SwiftUI

Issue #611

1
2
3
4
5
6
7
8
9
10
11
enum WindowPosition: String, CaseIterable {
case left
case top
case bottom
case right
}
Picker(selection: $preference.position, label: Text("Position")) {
ForEach(WindowPosition.allCases, id: \.self) {
Text($0.rawValue)
}
}

Comments