The offending element is the
let mSSIDDATA = SSIDDict["SSIDDATA"]
field. If I leave it as it is, it prints out to the log window as shown here.
Looking up SSID info for en0 SSIDDict Values: ["SSID": SKYF7BFF, "BSSID": 7c:4c:a5:c:8b:15, "SSIDDATA": <534b5946 37424646>]
mSSID: SKYF7BFF
mBSSID: 7c:4c:a5:c:8b:15
mSSIDDATA: <534b5946 37424646>
SSID: SKYF7BFF
BSSID: 7c:4c:a5:c:8b:15
SSIDDATA: <534b5946 37424646>
=========
However - It doesn't print out into the UITextField
in the iOS interface. The other two do, but this third one doesn't, and I can't figure out why.?
If I change the [String : Any]
to [String : AnyObject]
it creates another whole set of warnings and errors.
So basically, how do I convert that mSSIDDATA
to a string that the UITextField
can handle?
guard let SSIDDict: [String : Any] = (unwrappedCFDictionaryForInterface as NSDictionary) as? [String: AnyObject] else {
print("System error: interface information is not a string-keyed dictionary")
return false
}
print("SSIDDict Values: \(SSIDDict)")
let mSSID = SSIDDict["SSID"] as? String
let mBSSID = SSIDDict["BSSID"] as? String
let mSSIDDATA = SSIDDict["SSIDDATA"] //as? String
print("mSSID: \(mSSID ?? "")")
vSSID.text = mSSID
print("mBSSID: \(mBSSID ?? "")")
vBSSID.text = mBSSID
print("mSSIDDATA: \(mSSIDDATA ?? "")")
vSSIDDATA.text = mSSIDDATA as? String
for d in SSIDDict.keys {
print("\(d): \(SSIDDict[d]!)")
}
}
return true
}