I've just updated to Xcode 6 beta 6 and I have a following problem with my code which was working before
let reminderSubject = reminder["subject"]
println("reminderSubject: \(reminderSubject)")
let tempTuple = (reminderSubject as String)
reminderSubject is of type AnyObject?! when I try to downcast it to String it crashes with "Swift dynamic cast failure" message. The value printed by println is: Optional(Hey its Test!)
So the question is how to correctly cast AnyObject?! to String in Swift?
if let reminderSubject = reminder["subject"] { ... }, which would execute only if your reminder had a subject, and makereminderSubjectnon-optional. You may want to re-think your approach here; if you start seeing lots of exclamation marks it's a bit of a clue you're not writing particularly Swifty code, in my opinion. - Matt Gibson