3 ms·
The API would have the same delay and issues though, wouldn't it?
by Saris 3y ago
The API would have the same delay and issues though, wouldn't it?
- pornel 3y agoIt performs the check when the network changes, which may happen long before your app launches.
- robertofrenna 3y agoNot necessarily! `SCNetworkReachability` is deeply integrated within macOS, and is able to tell you very quickly whether e.g. the user has just roamed from one type of network to another: https://developer.apple.com/documentation/systemconfiguration/scnetworkreachabilityflags?language=objc https://developer.apple.com/documentation/systemconfiguratio... Even if you just went and turned off the Wi-Fi interface on your device, `SCNetworkReachability` would know straight away - and from the flags you can deduce exactly what happened and react accordingly. (I do agree though that it's a dangerous approach if it misbehaves, as it happened to me!)