RAC组合Merge

Merge:

//创建信号

    RACSubject *signalA = [RACSubject subject];

    RACSubject *signalB = [RACSubject subject];

    RACSubject *signalC = [RACSubject subject];


    //组合信号

    //RACSignal *mergeSignal = [signalA merge:signalB];

    RACSignal *mergeSignal = [RACSignal merge:@[signalA,signalB,signalC]];



    [mergeSignal subscribeNext:^(id  _Nullable x) {

        NSLog(@"%@",x);

    }];


    [signalC sendNext:@"signalC"];

    [signalA sendNext:@"signalA"];

    [signalB sendNext:@"signalB"];

打印:如下

2018-01-09 15:52:23.242862+0800 RAC101[1115:494750] signalC

2018-01-09 15:52:23.242991+0800 RAC101[1115:494750] signalA

2018-01-09 15:52:23.243026+0800 RAC101[1115:494750] signalB

你可能感兴趣的:(RAC组合Merge)