Created
July 22, 2020 03:49
-
-
Save alfianlosari/3bf84b37eaf63a1da495395ea80b245f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct FormList: View { | |
| @State var isProfileExpanded = true | |
| var body: some View { | |
| Form { | |
| Section { | |
| DisclosureGroup(isExpanded: $isProfileExpanded) { | |
| TextField("First Name", text: .constant("")) | |
| TextField("Last Name", text: .constant("")) | |
| TextField("Email", text: .constant("")) | |
| DatePicker("Birthday", selection: .constant(Date())) | |
| } label: { | |
| Text("Profile") | |
| .font(.headline) | |
| } | |
| } | |
| Section { | |
| DisclosureGroup { | |
| Toggle("Push", isOn: .constant(true)) | |
| Toggle("Email", isOn: .constant(true)) | |
| Toggle("SMS", isOn: .constant(false)) | |
| } label: { | |
| Text("Preferences") | |
| .font(.headline) | |
| } | |
| } | |
| } | |
| } | |
| } | |
| struct FormList_Previews: PreviewProvider { | |
| static var previews: some View { | |
| FormList() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment