Created
September 22, 2023 23:59
-
-
Save timsneath/3807696d2b27579232377078f00bf102 to your computer and use it in GitHub Desktop.
Replace the default `ContentView` struct with this...
This file contains hidden or 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
struct ContentView: View { | |
@State private var switchSetting = true | |
@State private var stepperValue = 11 | |
@State private var dateValue = Date.now | |
var body: some View { | |
NavigationView { | |
Form { | |
Section { | |
Toggle("On or off: you choose", isOn: $switchSetting) | |
Stepper(value: $stepperValue, in: 0...11) | |
{ Text("Awesomeness: \(stepperValue)")} | |
DatePicker(selection: $dateValue, label: { Text("Date") }) | |
} | |
header: { | |
Text("First Section") | |
} | |
footer: { | |
Text("This section contains some useful settings.") | |
} | |
Section { | |
Text("Hello, world!") | |
Text("Hello, world!") | |
Text("Hello, world!") | |
Text("Hello, world!") | |
} | |
header: { | |
Text("Second Section") | |
} | |
} | |
.navigationTitle("SwiftUI Config Demo") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment