Swift & the Objective-C Runtime

Nate Cook: Unfortunately, a load class method implemented in Swift is never called by the runtime, rendering that recommendation an impossibility. Instead, we’re left to pick among second-choice options: Implement method swizzling in initialize This can be done safely, so long as you check the type at execution time and wrap the swizzling in dispatch_once … Continue reading Swift & the Objective-C Runtime