Home > AI > IOS > SwiftUI >

labelsHidden

Example:

struct ContentView: View {
    @State var toggle1: Bool = false
    @State var toggle2: Bool = false
        
    var body: some View{
 
        VStack {
            Toggle(isOn: $toggle1) {
                Text("Toggle1")
            }
            .labelsHidden()

            Toggle(isOn: $toggle2) {
                Text("Toggle2")
            }
        }
    }
}

Leave a Reply