Lazy method swizzling, limited to 20 arguments.
UIView.swizzle🌪.layoutSubviews { (object, sup) -> in
sup.invoke()
}
UIViewController.swizzle🌪.viewDidAppear { (object, animated: Bool, sup) -> in
sup.invoke(animated)
}
class Greeter: NSObject {
@objc dynamic func greet(first: String, last: String) -> String {
return "Hello \(first) \(last)"
}
}
Greeter.swizzle🌪.greetWithFirstlast { (object, arguments: (first: NSString, last: NSString), sup) -> NSString in
return sup.invoke(arguments.first, arguments.last)
}
Oliver Letterer, [email protected]
stormborn is available under the MIT license. See the LICENSE file for more info.