我正在尝试显示所有可用的 WIFI 连接。它不起作用。这是我的代码:
import Foundation
import CoreWLAN
var cwInterface = CWInterface()
do {
let routers = try cwInterface.scanForNetworksWithSSID(nil)
print(routers)
} catch let error as NSError {
print("Error: \(error.localizedDescription)")
}
Run Code Online (Sandbox Code Playgroud)
我没有得到任何结果。我做错了什么?