Last active
December 17, 2015 14:08
-
-
Save ashfurrow/5621776 to your computer and use it in GitHub Desktop.
ReactiveCocoa Chaining Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RAC(self.textField.text) = [[[RACSignal interval:1] startWith:[NSDate date]] map:^id(NSDate *value) { | |
NSDateComponents *dateComponents = [[NSCalendar currentCalendar] components:NSMinuteCalendarUnit | NSSecondCalendarUnit fromDate:value]; | |
return [NSString stringWithFormat:@"%d:%02d", dateComponents.minute, dateComponents.second]; | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment