Xcode 6.2 - Expected type after 'as' Xcode 6.2 - Expected type after 'as' xcode xcode

Xcode 6.2 - Expected type after 'as'


The as! notation was not introduced until Xcode 6.3. You have Xcode 6.2, so you have to say simple as. Xcode 6.2 does not understand your as!; that is the cause of the compiler error you are getting.

(Note that if you take those ! away, then when you eventually switch to Xcode 6.3 you have will have to bring them all back again! It really is best not to change Xcode versions backwards and forwards like this. If your code was written originally with Xcode 6.3, you should stay with Xcode 6.3. The only problem is that in that case you cannot submit an app to the App Store until it goes final; right now it is still in beta.)


You don't have to add ! to as to unwrap your optional variable in XCode 6.2