Created
January 7, 2017 18:11
-
-
Save vikitripathi/95f4b40bd657eec2dd62d3498e6c0df9 to your computer and use it in GitHub Desktop.
dispatch_after a delay
This file contains 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
- (void)signInWithUsername:(NSString *)username password:(NSString *)password complete:(RWSignInResponse)completeBlock { | |
double delayInSeconds = 2.0; | |
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); | |
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ | |
BOOL success = [username isEqualToString:@"user"] && [password isEqualToString:@"password"]; | |
completeBlock(success); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment