I need my app to constantly listen for reachability changes and update my views according to the network status, i am thinking about using the notificationcenter, and let all my views listen for changes, but i have no idea how to implement this.
I know how to use the notificationcenter and Reachability but i can’t seem to find a place to implement the Reachability check.
Where should i check for network changes, and notify the other ViewControllers?
I don’t think AppDelegate is the right place, and if i put the Reachability check in a ViewController the network checking is only being performed as long as the ViewController is “active”.
Create a “singleton”
Reachabilityand initialize it at app launch.Let the singleton check for reachability periodically, e.g. with
NSTimer. It can then notify any other active views that registered withNSNotificationCenter.and