Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
- (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