Turn Network Off unplugging net cable and switch off Wi-Fi connection on Mac
Build and start project in Simulator
We get string "Offline" on output. Everything is fine right now.
Switch internet connection On connecting to WiFi. Run some net activity in project. Download some data successfully. Nothing happen in NotificationCenter about ReachabilityStatusChangedNotification.
Another scenario with same code.
Turn Network On unplugging net cable but switch Wi-Fi connection On
Build and start project in Simulator
We get string "Online" on output. Everything is fine right now.
Switch Wi-Fi off.
We get string "Offline" on output. Everything is perfect! But
Reconnect Wi-Fi. Run some net activity in project. Download some data successfully.
Ooops.
Nothing happen in NotificationCenter about ReachabilityStatusChangedNotification again.
Little experiment on XCODE 11.5
Add Reach.swift to project
Add code
to viewDidLoad() of ViewController
Turn Network Off unplugging net cable and switch off Wi-Fi connection on Mac
Build and start project in Simulator
We get string "Offline" on output. Everything is fine right now.
Switch internet connection On connecting to WiFi. Run some net activity in project. Download some data successfully. Nothing happen in NotificationCenter about ReachabilityStatusChangedNotification.
Another scenario with same code.
Turn Network On unplugging net cable but switch Wi-Fi connection On
Build and start project in Simulator
We get string "Online" on output. Everything is fine right now. Switch Wi-Fi off. We get string "Offline" on output. Everything is perfect! But Reconnect Wi-Fi. Run some net activity in project. Download some data successfully. Ooops. Nothing happen in NotificationCenter about ReachabilityStatusChangedNotification again.