Be careful with Obj-C bridging in Swift

Type casting in Swift allows us to treat an instance as a different instance of a superclass or subclass from its hierarchy. It's accomplished using the as operator. However, did you know that the as operator is also the Objective-C bridging operator? In this post, Bruno Rocha explains why we need to pay extra attention when casting to make sure we are not also bridging from Swift to Objective-C types.

Private APIs, Objective-C runtime, and Swift

Objective-C and Swift can be used together, and it's still very common for apps and projects to contain a mix of both. Calling public Objective-C APIs from Swift involves exposing the APIs via a bridging header. However, calling private, or Swift-unavailable, Objective-C APIs from our Swift code is also possible, thanks to Objective-C's dynamic nature. In this post, Victor Pavlychko focuses on accessing such APIs using the Objective-C runtime.