I have a JSON object/dictionary I retrieved from AFNetworking
and I want to conditionally unwrap the key into an array of strings.
var person: [String : AnyObject] = ...
if let interests = person["interests"] as [String]{
// Do something
}
I get the following error message: (String : AnyObject) is not convertible to [String]
. I don't think I can typecast person
to [String : Any]
because it comes out as [String : AnyObject]
from the AFNetworking
framework. Any ideas would be appreciated.