func currentSSID()-> String {
guard let wifiInterfaces = CNCopySupportedInterfaces() else { return nil }
let interfaceArr = CFBridgingRetain(wifiInterfaces) as! Array
if interfaceArr.count > 0 {
let interfaceName = interfaceArr[0] as CFString
let ussafeInterfaceData = CNCopyCurrentNetworkInfo(interfaceName)
if (ussafeInterfaceData != nil) {
let interfaceData = ussafeInterfaceData as! Dictionary<String, Any>
return interfaceData["SSID"] as? String
}
}
return nil
};