ios - RACSignal: Why use rac_textSignal a "defer" to return a RACSignal to self? -


the rac_textsignal-implementation uses "defer" return racsignal on "self". reason that?

this implementation:

- (racsignal *)rac_textsignal {     @weakify(self);     return [[[[[racsignal         defer:^{             @strongify(self);             return [racsignal return:self];         }]         concat:[self rac_signalforcontrolevents:uicontroleventeditingchanged]]         map:^(uitextfield *x) {             return x.text;         }]         takeuntil:self.rac_willdeallocsignal]         setnamewithformat:@"%@ -rac_textsignal", [self rac_description]]; } 

both deferred signal , concatenated signal send uitextfields (effectively self).

the deferred signal makes returned signal send stored text on subscription, [self rac_signalforcontrolevents:uicontroleventeditingchanged] sends on changes.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

node.js - Using Node without global install -

php - CakePHP HttpSockets send array of paramms -