A coder in the attic

Scripts from a coder

Delay function call with ReactiveCocoa

Delay a function call is possible with ReactiveCocoa with –[RACSignal delay:]

1
2
3
4
5
- (void)delayLogString:(NSString *)string timeInterval:(NSTimeInterval)timeInterval {
  [[[RACSignal empty] delay:timeInterval] subscribeComplete:^{
      NSLog(@"This log message is printed out after %f seconds", timeInterval);
  }];
}

Comments