| Start |
|---|
| Extending UIViewController and Swizzling viewDidLoad In Objective-C, method swizzling is the process of changing the implementation of an existing selector. This is possible due to the way Selectors are mapped on a dispatch table, or a table of pointers to functions or methods. Pure Swift methods are not dynamically dispatched by the Objective-C runtime, but we can still take advantage of these tricks on any class that inherits from Here, we will extend |
| Basics of Swift Swizzling Let's swap the implementation of |
| Basics of Swizzling - Objective-C Objective-C example of swizzling UIView's RemarksWhen using method swizzling in Swift there are two requirements that your classes/methods must comply with:
For a complete explanation of why this is required, check out Using Swift with Cocoa and Objective-C (opens new window): Requiring Dynamic Dispatch While the Requiring dynamic dispatch is rarely necessary. However, you must use
the Links |
Read Article
https://develop.horje.com/learn/1434/reference