Demo.swift
ContentView.swift
App.swift
import SwiftUI
struct SettingsForm: View {
@State private var name = ""
@State private var notifications = true
@State private var count = 1
var body: some View {
Form {
Section(header: Text("Profile")) {
TextField("Name", text: $name)
}
Section(header: Text("Preferences")) {
Toggle("Notifications", isOn: $notifications)
Stepper("Count: \(count)", value: $count, in: 1...10)
}
}
}
}
import SwiftUI
struct ContentView: View {
var body: some View {
SettingsForm()
}
}
import SwiftUI
@main
struct MyApp: App {
var body: some Scene {
WindowGroup { ContentView() }
}
}