class TargetClass {
func targetFunction() {
// do something
}
}
class TargetClassEmpty : TargetClass { // An empty class for save objc origin function
}
class TargetClassHook : TargetClassEmpty, DDSwiftHookable {
override func targetFunction() {
super.targetFunction(); // call origin function
}
}
TargetClassHook.enableHook(); // do hook
dondong, [email protected]
DDSwiftHook is available under the MIT license. See the LICENSE file for more info.