Reachability.swift
Reachability.swift copied to clipboard
Should Reachability be checking against previousFlags?
Currently I am using Reachability for a Mac project. While at work, I am connected to a WiFi network, and sometimes use Ethernet as well (two different networks). When I unplug from Ethernet (with a Wi-Fi connection in tact), Reachability does not call my callback because it is checking the 'previousFlags' variable
guard previousFlags != flags else { return }
in the reachabilityChanged method.
Ethernet is the primary interface when connected, and Wi-Fi is secondary. This could be more of a scope question, as technically the network is still reachable and a network connection exists, BUT the network I am using to access the Internet changed.
Should the app get notified in this event or not? Maybe the check was added to solve a different issue?