Question : toggle in swift
Answered by : fancy-flatworm-7imy9ovj7bjb
struct ContentView: View { @State private var showGreeting = true var body: some View { VStack { Toggle("Show welcome message", isOn: $showGreeting) if showGreeting { Text("Hello World!") } } }
}
Source : https://www.hackingwithswift.com/quick-start/swiftui/how-to-create-a-toggle-switch | Last Update : Sat, 25 Jun 22
Question : toggle button swift
Answered by : tony-sacco
Toggle("Show welcome message", isOn: $showGreeting) .toggleStyle(SwitchToggleStyle(tint: .red))
if showGreeting { Text("Hello World!") }
Source : https://www.hackingwithswift.com/quick-start/swiftui/how-to-create-a-toggle-switch | Last Update : Sun, 24 Apr 22