Introduction NWPathMonitor is a class in Network framework, which observes network status and monitor network interface. It’s available in iOS 12 or later.
import Network You must retain NWPathMonitor instances to get callbacks.
class NetworkMonitorViewController: ViewController { let monitor = NWPathMonitor() } requiredInterface lets you observe the specific network interface.
let wifiMonitor = NWPathMonitor(requiredInterfaceType: .wifi) Here is the list of interfaces that NWPathMonitor supports.
https://developer.apple.com/documentation/network/nwinterface/interfacetype
Detect network changes monitor.
NWPathMonitor · Yusuke Ohashi
Introduction NWPathMonitor is a class in Network framework, which observes network status and monitor network interface. It’s available in iOS 12 or later. import Network You must retain NWPathMonitor instances to get callbacks. class NetworkMonitorViewController: ViewController { let monitor = NWPathMonitor() } requiredInterface lets you observe the specific network interface. let wifiMonitor = NWPathMonitor(requiredInterfaceType: .wifi) Here is the list of interfaces that NWPathMonitor supports. https://developer.apple.com/documentation/network/nwinterface/interfacetype Detect network changes monitor.
https://yusuke.cloud/posts/nwpathmonitor/