I am pretty new to ReactiveCocoa and Objective-C. I see that in the following code there is usage of _subscribeCommand
but there isn't a place where it was declared. It coincides with the subscribeCommand
method. So is this a local variable?
- (RACCommand *)subscribeCommand {
if (!_subscribeCommand) {
NSString *email = self.email;
_subscribeCommand = [[RACCommand alloc] initWithEnabled:self.emailValidSignal signalBlock:^RACSignal *(id input) {
return [SubscribeViewModel postEmail:email];
}];
}
return _subscribeCommand;
}
Full code were found in this tutorial http://codeblog.shape.dk/blog/2013/12/05/reactivecocoa-essentials-understanding-and-using-raccommand/