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