问题
I am using NWPathMonitor(https://developer.apple.com/documentation/network/nwpathmonitor) to detect any network changes in my background process. I have noticed recently that every time I open an app and close it the handler is invoked. I also notice that there is no change in the path from the previous value that is passed. I am comparing these fields: interfaceType, supportsIpV4, supportsIpV6 and isSatisfied.
I have seen it many times consistently that when I open an app and close it by swiping it away the handler is invoked. I have observed this behaviour with following apps: App Store, Safari, Whatsapp apps.
Does anyone know why this happens? The reason I am concerned is that the time my background process takes to process this handler could be adding to the network delays on the device.
来源:https://stackoverflow.com/questions/64101673/why-is-nwpathmonitor-handler-invoked-when-there-is-no-change-in-path