Skip to content

Instantly share code, notes, and snippets.

@alfianlosari
Created July 22, 2020 03:49
Show Gist options
  • Select an option

  • Save alfianlosari/3bf84b37eaf63a1da495395ea80b245f to your computer and use it in GitHub Desktop.

Select an option

Save alfianlosari/3bf84b37eaf63a1da495395ea80b245f to your computer and use it in GitHub Desktop.
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