Swift, iOS: Reachability (NWPathMonitor) vs. Ping

472 views Asked by At

I'm implementing app functionality, that requires checking network reachability in a way such as: 1/ Send http request 2/ If it fails with specific kinds of error, plan to repeat request, when network is reachable 3/ When request completes successfully, fill the View's content

It is possible to use SCNetworkReachability or NWPathMonitor, but, as Apple informs, it may result in false negatives, and there is no way to deal with them.

The question is, why not to ping server multiple times instead? Likewise in Apple's SimplePing example? Is it a good approach?

Thank you.

0

There are 0 answers