AlarmGeneralSection.swift 723 B

12345678910111213141516171819202122232425
  1. // LoopFollow
  2. // AlarmGeneralSection.swift
  3. import SwiftUI
  4. struct AlarmGeneralSection: View {
  5. @Binding var alarm: Alarm
  6. var body: some View {
  7. Section(
  8. header: Text("General"),
  9. footer: Text("Give each alarm a unique name—especially if you’ve added more than one of the same kind—so you can tell them apart at a glance.")
  10. ) {
  11. HStack {
  12. Text("Name")
  13. TextField("Alarm Name", text: $alarm.name)
  14. .multilineTextAlignment(.trailing)
  15. .textFieldStyle(.plain)
  16. .foregroundColor(.secondary)
  17. }
  18. Toggle("Enabled", isOn: $alarm.isEnabled)
  19. }
  20. }
  21. }