and as a result what you want to happen will happen NSArray *names = @[@"apple", @"google", @"microsoft"]; NSMutableArray *decoratedNames = [NSMutableArray array]; for (int i = 0; i < names.count; i++ ) { decoratedNames[i] = [names[i] uppercaseString]; } // decoratedNames: @[ @"APPLE", @"GOOGLE", @"MICROSOFT" ] Monday, 8 July 13
to happen, and let the machine figure out how to do it id *decoratedNames = [@[@"apple", @"google", @"microsoft"] ! ! ! ! ! map:^id(NSString *name){ ! ! ! ! ! ! return [name uppercaseString]; ! ! ! ! ! }]; // decoratedNames: @[ @"APPLE", @"GOOGLE", @"MICROSOFT" ] Monday, 8 July 13
states • unwanted templates/boilerplate codes (delegates/protocols/KVO/notofications etc) • poor code locality (where does this code belong) Monday, 8 July 13
Macro - Subscribes from Key Path • RACSubject - Mutable signal • -rac_lift_selector - Make signals from method invocations • -rac_signalForControlEvents - Signals from UIControl action • -rac_addObserverForName - Signals from Notification center Monday, 8 July 13