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);
}];