Commit 840a9fcf by Demid Merzlyakov

Fix missing privacy notice in some cases.

parent 2b92823c
...@@ -23,7 +23,7 @@ class MenuViewController: UIViewController { ...@@ -23,7 +23,7 @@ class MenuViewController: UIViewController {
super.init(nibName: nil, bundle: nil) super.init(nibName: nil, bundle: nil)
self.viewModel.delegate = self self.viewModel.delegate = self
if #available(iOS 13.0, *) { if #available(iOS 13.0, *) {
NotificationCenter.default.addObserver(self, selector: #selector(appWillEnterBackgroundHandler), name: UIScene.willDeactivateNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(appWillEnterBackgroundHandler), name: UIScene.didEnterBackgroundNotification, object: nil)
} else { } else {
NotificationCenter.default.addObserver(self, selector: #selector(appWillEnterBackgroundHandler), name: UIApplication.willResignActiveNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(appWillEnterBackgroundHandler), name: UIApplication.willResignActiveNotification, object: nil)
} }
......
...@@ -29,16 +29,24 @@ class OnboardingViewController: UIViewController { ...@@ -29,16 +29,24 @@ class OnboardingViewController: UIViewController {
override func viewDidAppear(_ animated: Bool) { override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated) super.viewDidAppear(animated)
closing = false
promptForLocationAccess() promptForLocationAccess()
} }
var closing = false
private func close(animated: Bool) { private func close(animated: Bool) {
guard !closing else {
return
}
closing = true
self.presentingViewController?.dismiss(animated: animated, completion: { [weak self] in self.presentingViewController?.dismiss(animated: animated, completion: { [weak self] in
guard let self = self else { return } guard let self = self else { return }
self.coordinator.viewControllerDidEnd(controller: self) self.coordinator.viewControllerDidEnd(controller: self)
}) })
} }
private func promptForLocationAccess() { private func promptForLocationAccess() {
locationManager.useCurrentLocation(presentDialogsIn: self) { [weak self] (result) in locationManager.useCurrentLocation(presentDialogsIn: self) { [weak self] (result) in
guard let self = self else { return } guard let self = self else { return }
...@@ -69,6 +77,7 @@ extension OnboardingViewController: LocationManagerDelegate { ...@@ -69,6 +77,7 @@ extension OnboardingViewController: LocationManagerDelegate {
func locationManager(_ locationManager: LocationManager, updatedLocationsList newList: [Location]) { func locationManager(_ locationManager: LocationManager, updatedLocationsList newList: [Location]) {
if newList.count > 0 { if newList.count > 0 {
close(animated: true) close(animated: true)
locationManager.remove(delegate: self)
} }
} }
} }
...@@ -27,6 +27,7 @@ class TodayViewController: UIViewController { ...@@ -27,6 +27,7 @@ class TodayViewController: UIViewController {
init(coordinator:TodayCoordinator) { init(coordinator:TodayCoordinator) {
self.coordinator = coordinator self.coordinator = coordinator
super.init(nibName: nil, bundle: nil) super.init(nibName: nil, bundle: nil)
self.coordinator.delegate = self
} }
@available(*, unavailable) @available(*, unavailable)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment