Does migrating from Reachability to NWPathMonitor resolve simulator‑device reachability update discrepancies?
26.5K reputation · 24 Sept 2023, 11:31 UTC
Goal: Ensure that network reachability status updates reliably in both the iOS simulator and physical devices when running a production build.
Constraints: The solution must work on iOS versions still supported by the app, avoid using deprecated APIs that may be stripped in future releases, and deliver callbacks on the correct thread to prevent UI stalls caused by compiler optimizations in release builds.
Uncertainty: It is unclear whether replacing the legacy SCNetworkReachability‑based Reachability class with Apple’s NWPathMonitor eliminates the stale‑flag and delayed‑callback issues observed on devices, and what fallback strategy is required for devices running iOS 11 or earlier.
Does NWPathMonitor provide immediate and accurate reachability updates on both simulator and device when network interfaces change? What is the minimum iOS version required for NWPathMonitor, and how should the app handle older versions? Should a dual‑implementation approach be used, keeping Reachability as a fallback for unsupported releases?