I'm begin to use Reachability in my iOS project to test if there's internet connection or not.
My app consists in a UITabBarController
with 3 different tabs. Each tab's root is a different UIViewController
. In each controller I make several requests relying on user's actions.
My question is how to create a global function (or a macro) to use before each function that uses internet connection without rewriting this function in every controller.
Is possible to have a function that does this? I saw that there's a way to make the app sends notification relying on network status. But look at this example:
- The user tap a
UIButton
- Network is available and the request starts.
- If network goes down, how to stop the request and display for example a
UIAlertView
?
I've searched well but I can't find answers to my questions, thanks.