NotificationIdentifiers.swift 646 B

123456789101112131415161718192021222324252627282930
  1. import Foundation
  2. enum NotificationCategoryIdentifier: String {
  3. case glucoseAlert = "Trio.glucoseAlert"
  4. }
  5. enum NotificationResponseAction: String, CaseIterable {
  6. case snooze20 = "Trio.snooze20"
  7. case snooze1hr = "Trio.snooze1hr"
  8. case snooze3hr = "Trio.snooze3hr"
  9. case snooze6hr = "Trio.snooze6hr"
  10. var duration: TimeInterval {
  11. TimeInterval(minutes * 60)
  12. }
  13. var minutes: Int {
  14. switch self {
  15. case .snooze20:
  16. return 20
  17. case .snooze1hr:
  18. return 60
  19. case .snooze3hr:
  20. return 180
  21. case .snooze6hr:
  22. return 360
  23. }
  24. }
  25. }