Created
February 29, 2016 23:15
-
-
Save samjarman/aa59099cb8f56c47799d to your computer and use it in GitHub Desktop.
A snippet to listen for all notifications inside an app for learning/exploring frameworks.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSNotificationCenter *notifyCenter = [NSNotificationCenter defaultCenter]; | |
[notifyCenter addObserverForName:nil | |
object:nil | |
queue:nil | |
usingBlock:^(NSNotification* notification){ | |
// Explore notification | |
NSLog(@"Notification found with:" | |
"\r\n name: %@" | |
"\r\n object: %@" | |
"\r\n userInfo: %@", | |
[notification name], | |
[notification object], | |
[notification userInfo]); | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment