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 uitextfield
s (effectively self
).
the deferred signal makes returned signal send stored text on subscription, [self rac_signalforcontrolevents:uicontroleventeditingchanged]
sends on changes.
Comments
Post a Comment