Putting this in a command line macOS app and a playground yield different results. The app prints unavailable, the playground prints the SSID name.
import Foundation
import CoreWLAN
let client = CWWiFiClient.shared()
let ssid_name = client.interface()?.ssid() ?? "unavailable"
print(ssid_name)
Topic:
Programming Languages
SubTopic:
Swift
Tags: