Skip to content

Commit

Permalink
Update lifecycle handlers (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
m1entus authored Sep 28, 2022
1 parent 6604aae commit cb4d48d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ extension UIView {
func startObservingAppLifecycleNotifications() {
NotificationCenter.default.addObserver(self, selector: #selector(appDidBecomeActive), name: .applicationDidBecomeActiveNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(appDidEnterBackground), name: .applicationDidEnterForegroundNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(willTerminateNotification), name: .applicationDidEnterForegroundNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(willTerminateNotification), name: .applicationWillTerminateNotification, object: nil)
}

func stopObservingAppLifecycleNotications() {
NotificationCenter.default.removeObserver(self, name: .applicationDidEnterForegroundNotification, object: nil)
NotificationCenter.default.removeObserver(self, name: .applicationDidBecomeActiveNotification, object: nil)
NotificationCenter.default.removeObserver(self, name: .applicationDidEnterForegroundNotification, object: nil)
NotificationCenter.default.removeObserver(self, name: .applicationWillTerminateNotification, object: nil)
}
Expand Down

0 comments on commit cb4d48d

Please sign in to comment.