- (RACSignal *)merge:(RACSignal *)signal {
return [RACSignal
merge:@[ self, signal ]]; //(1)
}
+ (RACSignal *)merge:(id<NSFastEnumeration>)signals {
NSMutableArray *copiedSignals = [[NSMutableArray alloc] init];
for (RACSignal *signal in signals) {
[copiedSignals addObject:signal]; //(2)
}
return [[RACSignal
createSignal:^ RACDisposable * (id<RACSubscriber> subscriber) { //(3)
for (RACSignal *signal in copiedSignals) {
[subscriber sendNext:signal]; //(4)
}
[subscriber sendCompleted];
return nil;
}]flatten]; //(5)
}
网友评论