Yesterday I installed the official Xcode 7 and when I tried to open one of my Swift projects, appeared an alert saying that the new Xcode version wants to update my swift co
In my case, the cast I had to correct was similar to Murat Yasar answer ( https://stackoverflow.com/a/36867502/512403 ), but mine had two parts to correct. The compiler didn't work with the original fix, so I had to tweak my code still a bit more:
Bad version:
let jsonObject: AnyObject? = try NSJSONSerialization.JSONObjectWithData(data!, options: NSJSONReadingOptions.AllowFragments)
Good version:
let jsonObject = try? NSJSONSerialization.JSONObjectWithData(data!, options: NSJSONReadingOptions.AllowFragments) as! [String: AnyObject]
Maybe this can help someone new to these quirks of Swift.