First time seeing this error, can't i put '!' after 'as' in swift? Or just bug after updating my Xcode to 6.2?
let url = notification.userInfo![CallbackNotification.optionsURLKey] as! NSURL
It shows error : Expected type after 'as'
P.S: You can try download OAuthSwift from github to test this error. https://github.com/dongri/OAuthSwift
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With