Skip to content

Instantly share code, notes, and snippets.

@ashfurrow
Last active December 17, 2015 14:09
Show Gist options
  • Save ashfurrow/5622049 to your computer and use it in GitHub Desktop.
Save ashfurrow/5622049 to your computer and use it in GitHub Desktop.
ReactiveCocoa Starting Signal 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];
}] deliverOn:[RACScheduler mainThreadScheduler]];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment