RACSignal *signalA = [RACSignal createSignal:^RACDisposable * _Nullable(id<RACSubscriber> _Nonnull subscriber) {
NSLog(@"fasongA");
//发送 数据
[subscriber sendNext:@"shujuA"];
//A结束了
[subscriber sendCompleted];
return nil;
}];
RACSignal *signalB = [RACSignal createSignal:^RACDisposable * _Nullable(id<RACSubscriber> _Nonnull subscriber) {
NSLog(@"fasongB");
//发送 数据
[subscriber sendNext:@"shujuB"];
[subscriber sendCompleted];
return nil;
}];
//then A发送完毕 忽略前面A这个信号 只接收B的数据(A发送完毕 B在回来)
RACSignal *thenSignal = [signalA then:^RACSignal * _Nonnull{
return signalB;
}];
//订阅信号
[thenSignal subscribeNext:^(id _Nullable x) {
NSLog(@"thenSignal:%@",x);
}];
网友评论