IOS use RAC five lines of the core code to get the app start page advertising and countdown

Nonsense is not much to say, look at the picture, look at the implementation process,

IOS use RAC five lines of the core code to get the app start page advertising and countdown
Figure IOS use RAC five lines of the core code to get the app start page advertising and countdown

IOS use RAC five lines of the core code to get the app start page advertising and countdown

Kernel methods for interpretation:

The first 1 Parameters: / / per a call to the second index parameters for the total time, in seconds, block code block to execute a second, when the total time less than 0 [[[RACSignal interval:1 onScheduler:[RACScheduler mainThreadScheduler]] take:index] ad removal of subscribeNext:^ (ID x) {[btn setTitle:[NSString stringWithFormat:@%ld index] forState:UIControlStateNormal];
, skip index –
; LxDBAnyVar (index);
if (index &lt = 0;
) {[fullView removeFromSuperview]};

}];

/ / monitoring method, click the skip button to skip, namely view [[btn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^ (ID from x) {[fullView removeFromSuperview];

}];

Demo:https://github.com/cailingyun2010/CYPushImageManager