Adapt PreferencesView to embed in iOS SettingsView form

This commit is contained in:
Angelo Stavrow 2020-08-10 12:38:30 -04:00
parent 4b914891b7
commit 4d4e4be162
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE

View File

@ -4,6 +4,14 @@ struct PreferencesView: View {
@State private var appearance: Int = 0
var body: some View {
#if os(iOS)
Picker(selection: $appearance, label: Text("Appearance")) {
Text("System").tag(0)
Text("Light Mode").tag(1)
Text("Dark Mode").tag(2)
}
.pickerStyle(SegmentedPickerStyle())
#elseif os(macOS)
Form {
Picker(selection: $appearance, label: Text("Appearance")) {
Text("System").tag(0)
@ -13,6 +21,7 @@ struct PreferencesView: View {
.frame(width: 200, height: 100, alignment: .topLeading)
.pickerStyle(RadioGroupPickerStyle())
}
#endif
}
}