I appreciate your reply Meaton.
Yes, NWPathMonitor delegates whenver the network status changes and it works in iOS.
I have created a Cocoa(macOS) application and using NWPathMonitor, is it possible to get to know when MacBook Air WiFi connected to my cellular network via hotspot enabled.
My Cocoa app should identify whenever the network connected via Wi-Fi or via Celluar (hotspot enabled) network.
let monitor = NWPathMonitor(requiredInterfaceType: .wifi)
let queue = DispatchQueue.global(qos: .background)
monitor.start(queue: queue)
monitor.pathUpdateHandler = { path in
if path.status == .satisfied {
print("Connected")
}
}
if i change the requiredInterfaceType as ".cellular". am not getting the path.status as .satisfied. It always says interface type as .wifi even if i connected via cellular hotspot.