Skip to content

Instantly share code, notes, and snippets.

@samjarman
Created February 29, 2016 23:15
Show Gist options
  • Save samjarman/aa59099cb8f56c47799d to your computer and use it in GitHub Desktop.
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.
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