-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAQGroupBox.swift
65 lines (54 loc) · 1.82 KB
/
AQGroupBox.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// AQGroupBox.swift
// AQCoreSwiftUIKit (iOS)
//
// Created by Akash Yashavanthrao Shindhe on 07/02/21.
//
import SwiftUI
struct AQGroupBox: View {
@State var username: String = ""
@State var isPrivate: Bool = true
@State var notificationsEnabled: Bool = false
@State private var previewIndex = 0
var body: some View {
SectionView(title: "Group Box", description: "A stylized view with an optional label that is associated with a logical grouping of content.") {
Form {
GroupBox {
TextField("Username", text: $username)
Toggle(isOn: $isPrivate) {
Text("Private Account")
}
Text("default groupBox ")
.font(.footnote)
}
GroupBox(label: Text("Label"), content: {
Toggle(isOn: $notificationsEnabled) {
Text("Enabled")
}
Text("groupBox with label")
.font(.footnote)
})
GroupBox {
HStack {
Text("Version")
Spacer()
Text("2.2.1")
}
}
GroupBox {
Button(action: {
print("Perform an action here...")
}) {
Text("Reset All Settings")
}
}
}
.navigationBarTitle("Form")
}
}
}
struct AQGroupBox_Previews: PreviewProvider {
static var previews: some View {
AQGroupBox()
}
}