Skip to content

Instantly share code, notes, and snippets.

@ashfurrow
Last active December 17, 2015 14:08
Show Gist options
  • Save ashfurrow/5621776 to your computer and use it in GitHub Desktop.
Save ashfurrow/5621776 to your computer and use it in GitHub Desktop.
ReactiveCocoa Chaining Example
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