Now I know that when swift compiles it just makes a NSDictionary, but the NSDictionary and Swift dictionaries have different syntax. Is there a way (through a loop or something) to convert a NSDictionary to a swift dictionary of the same type for <key, value>
?
OR
Is there a way to convert this to a Swift dictionary instead of NSDictionary?
let jsonDict = NSJSONSerialization.JSONObjectWithData(jsonData, options: nil, error: &error) as NSDictionary
I found answer from http://www.swift-studies.com/blog/2014/6/6/loading-a-swift-dictionary-from-a-plist-file
use:
Just declare that it is Swift dictionary
NSDictionary
andDictionary
are pretty much interchangeable. So there's no need to, but yes you can: