It seems that when you print() an enumeration type from the macOS SDK (and presumably others), it prints out the type name, but when you print from your own enum it prints out the case name.
In the below example, I would expect to see "security case: wpaPersonalMixed" rather than "security case: CWSecurity".
Is there a trick to getting this working?
import CoreWLAN
// Working example
enum Numbers: Int {
case one = 1
}
print("number case: \(Numbers.one)") // "number case: one" <-- EXPECTED
print("number raw: \(Numbers.one.rawValue)") // "number raw: 1"
// Failing example
let wifiClient: CWWiFiClient = CWWiFiClient()
let interface: CWInterface = wifiClient.interface(withName: "en0")! // interface name is specific to my machine. YMMV
let security: CWSecurity = interface.security()
print("security case: \(security)") // "security case: CWSecurity" <-- PROBLEM
print("security raw: \(security.rawValue)") // "security raw: 3"
Swift 5.1 macOS SDK 10.4