Demo.swift
ContentView.swift
App.swift
import SwiftUI
struct InputsDemo: View {
@State private var name = ""
@State private var enabled = true
@State private var choice = 1
var body: some View {
Form {
TextField("Name", text: $name)
Toggle("Enabled", isOn: $enabled)
Picker("Choice", selection: $choice) {
Text("One").tag(1); Text("Two").tag(2)
}
}
}
}
import SwiftUI
struct ContentView: View {
var body: some View { InputsDemo() }
}
import SwiftUI
@main
struct MyApp: App {
var body: some Scene {
WindowGroup { ContentView() }
}
}