Network Path Monitoring
In iOS 11, Apple recommended you stop using the reachability API to check network availability before attempting a connection. Instead you configure a
URLSessionto wait for connectivity.The wait for connectivity model works better for creating connections but I still sometimes want to show the user a network status indicator.
[…]
Apple released the
Networkframework in iOS 12, macOS 10.14. It includes aNWPathMonitorthat is now the preferred way to monitor changes to network status. The three steps to monitor network changes[…]