Created
July 31, 2015 15:39
-
-
Save xNekOIx/403238e5fc0a169e3a9f to your computer and use it in GitHub Desktop.
Dots activity indicator
This file contains hidden or 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
RACSignal* activitySignal = [[RACObserve(self, viewModel.inProgress) map:^id(NSNumber* value) { | |
if (value.boolValue == NO) return [RACSignal return:@""]; | |
return [[RACSignal interval:0.5 onScheduler:[RACScheduler mainThreadScheduler]] | |
scanWithStart:@"." | |
reduce:^id(NSString* previous, id current) { | |
if (previous.length > 2) return @"."; | |
return [previous stringByAppendingString:@"."]; | |
}]; | |
}] switchToLatest]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment