IOS monitoring network change case source code, ios monitoring case source code
With the upgrade of Mobile Networks: 2G-> 3G-> 4G, or even 5G under development, the network speed is getting faster and faster, but the traffic is also like a flow of water.
The Internet does not spread a story: if you forget to turn off traffic during sleep, the house will be moved the next day!
This is an exaggerated statement, but as an excellent App developer, we need to give the most appropriate prompt in the App.
When a large amount of traffic is required (for example, video or download), some tips are given.
During the user's video period, the user will prompt whether to continue watching the video when switching the network!
The following describes how to monitor network status changes in real time!
I am using the most widely used network monitoring class: Reachability
Click here to download the Demo of this article: (see the attachment below)
Decompress the downloaded file in the upper part and add the NetworkReachability folder to the project you want to add.
Example Description: This example is used to demonstrate how to use the systempolicatio Reachalility program interface to determine the related network connection status and status change. Therefore, the Reachability in this example is used. the premise of the (h/m) file in your own project is that SystemConfiguration must be introduced. framework.
See attachment for source code
Http://ios.662p.com/thread-2297-1-1.html