Peter Steinberger 6/26/2019

Swizzling in Swift

Read Original

This technical article explains method swizzling (monkey patching) in Swift, detailing how to replace or augment method implementations in Objective-C-based classes. It covers the typical swizzling approach, the requirement for @objc dynamic dispatch, potential pitfalls, and includes a code example for UIView. The article also discusses real-world issues like crashes from SDK conflicts and the impact of bitcode.

Swizzling in Swift

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser