Skip to content

Instantly share code, notes, and snippets.

@snosrap
Created October 24, 2017 11: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 snosrap/ffb1124312985f89476387a37b2a341f to your computer and use it in GitHub Desktop.
Save snosrap/ffb1124312985f89476387a37b2a341f to your computer and use it in GitHub Desktop.
@interface FPDistributedNotificationCenter : NSObject
@end
@implementation FPDistributedNotificationCenter
- (id)init {
if(self = [super init]) {
[NSDistributedNotificationCenter.defaultCenter addObserver:self selector:@selector(receivedDistributedNotification:) name:nil object:nil];
}
return self;
}
- (void)dealloc {
[NSDistributedNotificationCenter.defaultCenter removeObserver:self];
}
- (void)receivedDistributedNotification:(NSNotification *)notification {
NSLog(@"%@\n%@\n%@", notification.name, notification.object, notification.userInfo);
}
@end
@snosrap
Copy link
Author

snosrap commented Oct 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment