Objective-C library which allows user to retry certain actions
When you call retry:(MSRetryActionBlock)actionBlock withMessage:(NSString *)message
function it shows alert view with your message and buttons "Cancel" and "Retry".
If user taps "Cancel" nothing is going, but if user taps "Retry" then actionBlock
will be runned. If you call retry:(MSRetryActionBlock)actionBlock withMessage:(NSString *)message
when alert view is shown, then action will be putted in queue and when user
taps "Retry" all actions in queue will be runned.
You run several actions in same time and all of them are depending on internet connetion. User doesn't have internet connection and all acctions will fail. You will show alert for every action then user have to tap "Retry" for every action. But with this queue user have to tap only once and all actions will be retried.
Clone as submodule to your project:
git submodule add https://github.com/metastudio/MSRetry.git lib/MSRetry
Add UIAlertView-Blocks library as submodule:
git submodule add https://github.com/metastudio/UIAlertView-Blocks.git lib/UIAlertView-Blocks
Add .h
and .m
files from both libraries to your Xcode project.
Import MSRetryAlertQueue.h
file:
#import "MSRetryAlertQueue.h"
And call your repeated action in block:
[MSRetryAlertQueue retry:^{
[[UserProgram currentProgram] loadCurrentProgram];
} withMessage:error.localizedDescription];