mirror of
https://github.com/yattee/yattee.git
synced 2024-12-12 21:30:32 +05:30
8 lines
349 B
Swift
8 lines
349 B
Swift
extension NSObject {
|
|
class func swizzle(origSelector: Selector, withSelector: Selector, forClass: AnyClass) {
|
|
let originalMethod = class_getInstanceMethod(forClass, origSelector)
|
|
let swizzledMethod = class_getInstanceMethod(forClass, withSelector)
|
|
method_exchangeImplementations(originalMethod!, swizzledMethod!)
|
|
}
|
|
}
|