Skip to content

Instantly share code, notes, and snippets.

@rizumita
Created December 5, 2013 08:53
Show Gist options
  • Save rizumita/7802174 to your computer and use it in GitHub Desktop.
Save rizumita/7802174 to your computer and use it in GitHub Desktop.
NSNotificationCenter/NSNotificationをReactiveCocoaで利用する方法。selfが解放される時に自動的に通知が停止する。
[[[[NSNotificationCenter defaultCenter] rac_addObserverForName:notification object:nil] takeUntil:[self rac_willDeallocSignal]] subscribeNext:^(NSNotification *notification) {
NSLog(@"%@", notification);
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment