diff --git a/Clocker/Clocker/LocationController.swift b/Clocker/Clocker/LocationController.swift index 60eb8a2..9a182d4 100644 --- a/Clocker/Clocker/LocationController.swift +++ b/Clocker/Clocker/LocationController.swift @@ -118,7 +118,6 @@ extension LocationController: CLLocationManagerDelegate { } else if status == .notDetermined || status == .authorized || status == .authorizedAlways { locationManager.startUpdatingLocation() } - delegate?.didChangeAuthorizationStatus() } func locationManager(_: CLLocationManager, didFailWithError error: Error) { diff --git a/Clocker/Onboarding/Onboarding.storyboard b/Clocker/Onboarding/Onboarding.storyboard index b854fdc..fa0972e 100644 --- a/Clocker/Onboarding/Onboarding.storyboard +++ b/Clocker/Onboarding/Onboarding.storyboard @@ -168,10 +168,10 @@ DQ - + - + @@ -179,7 +179,7 @@ DQ - + @@ -197,7 +197,7 @@ DQ - + @@ -208,17 +208,17 @@ DQ - + - + - + @@ -226,7 +226,7 @@ DQ - + @@ -234,7 +234,7 @@ DQ - + @@ -242,7 +242,7 @@ DQ - + @@ -266,7 +266,7 @@ DQ - + @@ -297,65 +297,15 @@ DQ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -371,11 +321,6 @@ DQ - - - - - diff --git a/Clocker/Onboarding/OnboardingPermissionsViewController.swift b/Clocker/Onboarding/OnboardingPermissionsViewController.swift index f7e8588..70f6048 100644 --- a/Clocker/Onboarding/OnboardingPermissionsViewController.swift +++ b/Clocker/Onboarding/OnboardingPermissionsViewController.swift @@ -6,7 +6,6 @@ import CoreLoggerKit class OnboardingPermissionsViewController: NSViewController { @IBOutlet var reminderGrantButton: NSButton! @IBOutlet var calendarGrantButton: NSButton! - @IBOutlet var locationGrantButton: NSButton! @IBOutlet var reminderView: NSView! @IBOutlet var calendarView: NSView! @@ -32,7 +31,7 @@ class OnboardingPermissionsViewController: NSViewController { override func viewDidLoad() { super.viewDidLoad() - [calendarView, reminderView, locationView].forEach { $0?.applyShadow() } + [calendarView, reminderView].forEach { $0?.applyShadow() } setup() } @@ -46,29 +45,25 @@ class OnboardingPermissionsViewController: NSViewController { onboardingTypeLabel.stringValue = "Your data doesn't leave your device 🔐" reminderHeaderLabel.stringValue = NSLocalizedString("Reminders Access Title",comment: "Title for Reminders Access Label") - reminderDetailLabel.stringValue = "Set reminders in the timezone of the location of your choice." + reminderDetailLabel.stringValue = "Set reminders in the timezone of the location of your choice. Your reminders are stored in the default Reminders app." calendarHeaderLabel.stringValue = NSLocalizedString("Calendar Access Title",comment: "Title for Calendar access label") calendarDetailLabel.stringValue = "Calendar Detail".localized() - - locationHeaderLabel.stringValue = "Location Access" - locationDetailLabel.stringValue = "Accurately track your local time; especially useful if you travel." [calendarHeaderLabel, calendarDetailLabel, privacyLabel, reminderDetailLabel, reminderHeaderLabel, onboardingTypeLabel, appLabel].forEach { $0?.textColor = Themer.shared().mainTextColor() } } private func setupButtons() { - let locationController = LocationController.shared() - if locationController.locationAccessGranted() { - locationGrantButton.title = "Granted" - } else if locationController.locationAccessDenied() { - locationGrantButton.title = "Denied" - } else if locationController.locationAccessNotDetermined() { - locationGrantButton.title = "Grant" - } else { - locationGrantButton.title = "Unexpected" - } +// if LocationController.sharedInstance.locationAccessGranted() { +// locationButton.title = "Granted" +// } else if LocationController.sharedInstance.locationAccessDenied() { +// locationButton.title = "Denied" +// } else if LocationController.sharedInstance.locationAccessNotDetermined() { +// locationButton.title = "Grant" +// } else { +// locationButton.title = "Unexpected" +// } if EventCenter.sharedCenter().calendarAccessGranted() { calendarGrantButton.title = "Granted".localized() @@ -153,36 +148,4 @@ class OnboardingPermissionsViewController: NSViewController { reminderGrantButton.title = "Denied".localized() } } - - @IBAction func locationAction(_: NSButton) { - let locationController = LocationController.shared() - if locationController.locationAccessNotDetermined() { - locationController.delegate = self - locationActivityIndicator.startAnimation(nil) - locationController.determineAndRequestLocationAuthorization() - } else if locationController.locationAccessDenied() { - locationGrantButton.title = "Denied".localized() - } else if locationController.locationAccessGranted() { - locationGrantButton.title = "Granted".localized() - } - } - - private func setupLocationButton() { - let locationController = LocationController.shared() - if locationController.locationAccessNotDetermined() { - locationGrantButton.title = "Grant".localized() - } else if locationController.locationAccessDenied() { - locationGrantButton.title = "Denied".localized() - } else if locationController.locationAccessGranted() { - locationGrantButton.title = "Granted".localized() - } - } -} - -extension OnboardingPermissionsViewController: LocationControllerDelegate { - - func didChangeAuthorizationStatus() { - locationActivityIndicator.stopAnimation(nil) - setupLocationButton() - } }