Re:Building a Production Server Swift App
by rudedogg on Monday December 19, 2016 @06:14PM
(#13215857)
String bridges to NSString, are you sure you need to cast?
I think String now is part of Any and NSString still is AnyObject. You need to cast, but the cast will always succeed.
It's type safe language but all the type safety comes with price and some time the code written is just sucks. Json parsing is one example of this. All the casting and all that really make code horrible.
In swift 3 they made all value types to Any and in iOS communicating between Cocoa frameworks become a really mess as all expect some objc type etc. Implicit conversion is also removed and now you have to cast String to NSString and I really mad about this my code now looks horrible huh....