Skip to content

Instantly share code, notes, and snippets.

@kean
Last active April 22, 2016 08:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kean/23b1a0303affbb4f245d5fd06cc0ceca to your computer and use it in GitHub Desktop.
Save kean/23b1a0303affbb4f245d5fd06cc0ceca to your computer and use it in GitHub Desktop.
- (void)_fetchSomethingOrDieWithCompletion:(void (^)(id something))completion {
_autoRetryController = [[[GMURLAutoRetryController alloc] initWithBlock:^(GMAutoRetryController * _Nonnull controller) {
[/* start request with */ completion:^(id __nullable something, NSError * __nullable error) {
if (error) {
[controller scheduleAutoRetryWithError:error];
} else {
completion(something);
}
}];
}] resume];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment