Well, I can give you an easier and faster technique. Run the the getIPaddresses
method from this answer before asking the user, and save the info (or at least the count). You should see something like this:
"awdl0/ipv6" = "0:0:fe80::6456:66ff";
"en0/ipv4" = "192.168.1.4";
"en0/ipv6" = "0:0:fe80::4e5:772f";
"lo0/ipv4" = "127.0.0.1";
"lo0/ipv6" = "0:0:fe80::";
"pdp_ip0/ipv4" = "10.226.14.199";
These are all the active IP addresses. Now ask them to turn Airplane Mode on. When they tap yes, then run that code again, and the returned dictionary should be nil. If it isn't, and its the same as before, they lied!
I did look to see if Airplane mode would turn the interfaces OFF (interface->ifa_flags & IFF_UP
) but it does not, and the two loopback addresses are always active.