Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: c975ca7205
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (23 sloc) 0.833 kB
//
// NSNotificationCenter+RACSupport.m
// ReactiveCocoa
//
// Created by Josh Abernathy on 5/10/12.
// Copyright (c) 2012 GitHub. All rights reserved.
//
#import "NSNotificationCenter+RACSupport.h"
#import <ReactiveCocoa/EXTScope.h>
@implementation NSNotificationCenter (RACSupport)
- (RACSignal *)rac_addObserverForName:(NSString *)notificationName object:(id)object {
@unsafeify(object);
return [[RACSignal createSignal:^(id<RACSubscriber> subscriber) {
@strongify(object);
id observer = [self addObserverForName:notificationName object:object queue:nil usingBlock:^(NSNotification *note) {
[subscriber sendNext:note];
}];
return [RACDisposable disposableWithBlock:^{
[self removeObserver:observer];
}];
}] setNameWithFormat:@"-rac_addObserverForName: %@ object: %@", notificationName, object];
}
@end
Jump to Line
Something went wrong with that request. Please try again.