We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5f1230 commit 018b646Copy full SHA for 018b646
1 file changed
Demo/App.swiftpm/Sources/FormPlaygrounds.swift
@@ -0,0 +1,28 @@
1
+#if canImport(AndroidSwiftUI)
2
+import AndroidSwiftUI
3
+#else
4
+import SwiftUI
5
+#endif
6
+
7
+struct FormPlayground: View {
8
+ @State private var wifi = true
9
+ @State private var bluetooth = false
10
+ @State private var brightness = 0.6
11
+ @State private var name = ""
12
+ var body: some View {
13
+ Form {
14
+ Section("Connectivity") {
15
+ Toggle("Wi-Fi", isOn: $wifi)
16
+ Toggle("Bluetooth", isOn: $bluetooth)
17
+ }
18
+ Section(header: "Display", footer: "Drag to adjust the screen brightness.") {
19
+ Slider(value: $brightness, in: 0...1)
20
+ HStack { Text("Level"); Spacer(); Text("\(Int(brightness * 100))%") }
21
22
+ Section("Account") {
23
+ TextField("Name", text: $name)
24
+ HStack { Text("Status"); Spacer(); Text(name.isEmpty ? "Guest" : name) }
25
26
27
28
+}
0 commit comments