diff --git a/ProjectClock/AlarmActivator.swift b/ProjectClock/AlarmActivator.swift index 2f48d1b..8f757d4 100644 --- a/ProjectClock/AlarmActivator.swift +++ b/ProjectClock/AlarmActivator.swift @@ -25,9 +25,21 @@ class AlarmActivator: UITabBarController /// Timer for getting family alarm updates var familyTimer: Timer? + /** + Called when the app started + */ override func viewDidLoad() { start() + + // Get notification permissions from user + UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { success, error in + if success { + print("All set!") + } else if let error = error { + print(error.localizedDescription) + } + } } /** diff --git a/ProjectClock/AlarmViewController.swift b/ProjectClock/AlarmViewController.swift index 64090eb..46019fa 100644 --- a/ProjectClock/AlarmViewController.swift +++ b/ProjectClock/AlarmViewController.swift @@ -8,15 +8,6 @@ class AlarmViewController: UIViewController override func viewDidLoad() { super.viewDidLoad() - - //Get notification permissions from user - UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { success, error in - if success { - print("All set!") - } else if let error = error { - print(error.localizedDescription) - } - } // Assign table delegate and data source AlarmViewController.staticTable = table diff --git a/ProjectClock/DebugViewController.swift b/ProjectClock/DebugViewController.swift index 19af623..fc788f3 100644 --- a/ProjectClock/DebugViewController.swift +++ b/ProjectClock/DebugViewController.swift @@ -21,15 +21,6 @@ class DebugViewController: EndEditingOnReturn super.viewDidLoad() wvmStepper.maximumValue = Double(wvms.count - 1) - // Request notification permission - UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { success, error in - if success { - print("All set!") - } else if let error = error { - print(error.localizedDescription) - } - } - // End editing on return wvmInput.delegate = self }