Overview
In network applications, it is necessary to monitor the network status set by the user in real time, so that the user can understand the network status and prompt the user if there is a network problem.
Generally, some processing needs to be done in the scenario of poor network status, such as:
- WIFT/3G/4G network: Automatically download high-definition pictures. Download thumbnails for scenes with bad network.
- No network showing offline cached data
Network Monitoring
Option One
Apple's official Reachability sample program.
Download addresshttps: //developer.apple.com/library/ios/samplecode/Reachability/Reachability.zip