Skip to content

Instantly share code, notes, and snippets.

@adamweeks
Last active December 20, 2015 17:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamweeks/6166059 to your computer and use it in GitHub Desktop.
Save adamweeks/6166059 to your computer and use it in GitHub Desktop.
Simulating network latency.
NSInteger delayTime = 2;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delayTime * NSEC_PER_SEC), dispatch_get_current_queue(), ^{
[self updateViewWithData];
});
@adamweeks
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment