Skip to content

Instantly share code, notes, and snippets.

@mps
Created September 4, 2019 18:48
Show Gist options
  • Save mps/c5ae0399f076187081393878dca9f702 to your computer and use it in GitHub Desktop.
Save mps/c5ae0399f076187081393878dca9f702 to your computer and use it in GitHub Desktop.
Code I found today
- (void) handleRequest
{
// Wait up to five seconds for the network to be worth trying.
for (int i = 0; i < 5; i++)
{
if (NetworkWorthTrying()) return;
[NSThread sleepForTimeInterval:1.0];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment