#ssid #wifi
static func getSSID() -> String? {
if let interface = (CNCopySupportedInterfaces() as? [String])?.first,
let unsafeInterfaceData = CNCopyCurrentNetworkInfo(interface as CFString) as? [String: Any],
let ssid = unsafeInterfaceData["SSID"] as? String {
return ssid
}
return nil
}