-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAQToggle.swift
45 lines (39 loc) · 1.38 KB
/
AQToggle.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// AQToggle.swift
// TestingGitLink
//
// Created by Akash Yashavanthrao Shindhe on 26/01/21.
//
import SwiftUI
struct AQToggle: View {
@State private var vibrateOnRing = false
var body: some View {
Form {
SectionView(title: "Toggle", description: "A control that toggles between on and off states.",codeSample: ".DefaultToggleStyle") {
Toggle(isOn: $vibrateOnRing, label: {
Text("Vibrate on Ring")
})
.toggleStyle(DefaultToggleStyle())
}
SectionView(title: "Toggle", description: "A control that toggles between on and off states.",codeSample: ".SwitchToggleStyle") {
Toggle(isOn: $vibrateOnRing, label: {
Text("Vibrate on Ring")
})
.toggleStyle(SwitchToggleStyle())
}
#if os(OSX)
SectionView(title: "Toggle", description: "A control that toggles between on and off states.",codeSample: ".CheckboxToggleStyle") {
Toggle(isOn: $vibrateOnRing, label: {
Text("Vibrate on Ring")
})
.toggleStyle(CheckboxToggleStyle())
}
#endif
}
}
}
struct AQToggle_Previews: PreviewProvider {
static var previews: some View {
AQToggle()
}
}