Search code examples
iosswift3gpswifi

How to detect if iOS Wifi hardware is ON swift 3


I'm trying to check if the WIFI hardware is on. I don't care if it is connected to internet or not. I just need to know if in the config the wifi is on. I need this because I will be using the GPS and I want to assure that I get the best accuracy.


Solution

  • enum ReachabilityType: CustomStringConvertible {
        case wwan
        case wiFi
        var description: String {
            switch self {
            case .wwan: return "WWAN"
            case .wiFi: return "WiFi"
            }
        }
    }