Skip to content

Instantly share code, notes, and snippets.

@LacertosusRepo
Forked from cppforlife/gist:3731520
Last active March 11, 2021 06:53
Show Gist options
  • Save LacertosusRepo/d91d5969f16b9fe4a64c1628e4ac2ea5 to your computer and use it in GitHub Desktop.
Save LacertosusRepo/d91d5969f16b9fe4a64c1628e4ac2ea5 to your computer and use it in GitHub Desktop.
Log local notifications.
void printNotification(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) {
if([(__bridge NSString *)name containsString:@"UIViewAnimation"]) {
return;
}
os_log(OS_LOG_DEFAULT, "name: %@\ninfo: %@\ncenter: %@", name, userInfo, center);
}
%ctor {
CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), NULL, printNotification, NULL, NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment