Drop-in replacement for Apple's Reachability class, with blocks and GCD
open sourceBSD-2-Clausefree
Reachability is a drop-in replacement for Apple's Reachability sample class for checking network connectivity on iOS, macOS and tvOS. It is ARC-compatible and uses GCD to notify you when network interfaces change, either through the standard NSNotification or through blocks called when the network becomes reachable or unreachable, and you can choose whether a cellular (WWAN) connection counts as reachable.
Problems it solves
- detect when an iOS app loses or regains its internet connection
- check whether a host is reachable before making a request on iOS
- react to Wi-Fi versus cellular changes in an Objective-C app
Features
- Drop-in replacement for Apple's Reachability class
- Reachable and unreachable blocks as well as NSNotification
- Uses GCD to notify of network interface changes
- Option to treat cellular (WWAN) as reachable or not
Limitations
- Apps have reportedly been rejected when Reachability is used inside a framework; the only known fix is to rename the class1
