The following code crashes in XCode 8 when running on iOS 10 (does not crash on previous iOS versions):
let dateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SS'Z'"
dateFormatter.timeZone = NSTimeZone(name: "UTC")
dateFormatter.locale = NSLocale.currentLocale()
let date = dateFormatter.dateFromString("2016-09-04T08:32:46.195514289Z")!
The crash happens because the date formatter returns nil. I tried playing and changing the dateFormat but the result is always nil. Did something change in iOS 10?
EDIT: same code works in Storyboard when running with Swift 3. It seems that the issue happens with Swift 2.3 and iOS 10