ReactiveCocoa操作方法-秩序
2016-08-15 本文已影响15人
傻傻小萝卜
doNext:
执行Next之前,会先执行这个Block
doCompleted:
执行sendCompleted之前,会先执行这个Block
[[[[RACSignal createSignal:^RACDisposable*(id subscriber) {
[subscriber sendNext:@"doNext"];
[subscriber sendCompleted];
return nil;
}]
doNext:^(idx) {//执行[subscriber sendNext:@"doNext"];前调用
NSLog(@"beforeDonext");
}]
doCompleted:^{//执行[subscriber sendCompleted];前调用
NSLog(@"afterDonext,beforeComplete");
}]
subscribeNext:^(idx) {
NSLog(@"%@",x);
}];