Skip to content

Instantly share code, notes, and snippets.

@action456789
Created March 21, 2018 02:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save action456789/a5b5e4028531a1f7ff7fd6dc444e39b6 to your computer and use it in GitHub Desktop.
Save action456789/a5b5e4028531a1f7ff7fd6dc444e39b6 to your computer and use it in GitHub Desktop.
[NSNotification] #Objective-C
- (void)addNotification {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationDidBecomeActive) name:UIApplicationDidBecomeActiveNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationWillResignActive)
name: UIApplicationWillResignActiveNotification
object:nil];
}
- (void)removeNotification {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)applicationWillResignActive {
}
- (void)applicationDidBecomeActive {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment