ios - RACSignal interval not work immediately -


i'm trying use racsignal class's interval method of reactivecocoa. following code works every second after 1 seconds. want works , every second. what's best way?

@weakify(self); [[[racsignal interval:1.0] takeuntilblock:^bool(id x) {     return [aclass count] == 0; }] subscribenext:^(id x) {     dispatch_async(dispatch_get_main_queue(), ^{         @strongify(self);         nsuinteger count = [aclass count];         self.title = [nsstring stringwithformat:@"%u", count];     }); }      completed:^{     dispatch_async(dispatch_get_main_queue(), ^{         @strongify(self);         self.title = @"";     }); }]; 

i believe you're looking -startwith:.

[[[racsignal interval:1] startwith:nsdate.date] takeuntilblock:^(id _) { // ... 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -