Skip to content

Instantly share code, notes, and snippets.

@CreatureSurvive
Last active August 14, 2018 21:04
Show Gist options
  • Select an option

  • Save CreatureSurvive/3a39da9e240b44ed66175750a2993211 to your computer and use it in GitHub Desktop.

Select an option

Save CreatureSurvive/3a39da9e240b44ed66175750a2993211 to your computer and use it in GitHub Desktop.
Am I insane, or should one of these methods be working with NoctisXI
- (void)applicationDidFinishLaunching: (UIApplication *)application {
%orig;
NSLog(@"registering for noctis notifications");
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
// with SEL callbacks
[center addObserver:self selector:@selector(__didRecieveNoctisNotification:) name:@"com.laughingquoll.noctis.enablenotification" object:nil];
[center addObserver:self selector:@selector(__didRecieveNoctisNotification:) name:@"com.laughingquoll.noctis.disablenotification" object:nil];
// with block callbacks
[center addObserverForName:@"com.laughingquoll.noctis.enablenotification" object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) {
NSLog(@"notification received block [%@]", notification.description);
}];
[center addObserverForName:@"com.laughingquoll.noctis.disablenotification" object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification){
NSLog(@"notification received block [%@]", notification.description);
}];
}
%new - (void)__didRecieveNoctisNotification: (NSNotification *)notification {
NSLog(@"notification received [%@]", notification.description);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment