Stats

139 Contributors: 5
2016-09-30
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook

Checking for Network Connectivity

Download ios eBook

Remarks

The source code for Reachability.h and Reachability.m can be found on Apple's developer documentation site.

Caveats

Unlike other platforms, Apple is yet to provide a standard set of APIs to determine an iOS device's network status and offer only these code examples linked above. The source file change over time, but once imported into an app project, they are seldom updated by the developers.

For this reason most app developers tend to use one of the many Github/Cocoapod maintained libraries for reachability.

Apple also recommends, for requests made at the user’s behest, that you always attempt a connection first, before using Reachability/SCNetworkReachability to diagnose the failure or to wait for the connection to return.

Related Examples