Last active
December 20, 2015 17:08
-
-
Save adamweeks/6166059 to your computer and use it in GitHub Desktop.
Simulating network latency.
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
NSInteger delayTime = 2; | |
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delayTime * NSEC_PER_SEC), dispatch_get_current_queue(), ^{ | |
[self updateViewWithData]; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I have test data that I want to use in a new view, but get the feeling of downloading it from a network service, I use the dispatch_after() GCD method.