Swift changed a lot with Xcode 6.3. I had to replace dozens of places in each of my app as
-> as!
. Why, what are the rules now?
According to the release notes:
The notions of guaranteed conversion and “forced failable” conversion are now separated into two operators. Forced failable conversion now uses the as! operator. The ! makes it clear to readers of code that the cast may fail and produce a runtime error. The “as” operator remains for upcasts (e.g. “someDerivedValue as Base”) and type annotations (“0 as Int8”) which are guaranteed to never fail.