-
A method hook.
replacement
represents an Objective-C methodIMP
. It should be a@convention(c)
function which takesself: AnyObject
and_cmd: Selector
as its first two arguments. The remaining argument types should be the argument types of the hooked Objective-C method in order, and the return type should be the return type of the method.saveOrig
is a closure which will be passed the original method implementation when the hook is applied.Declaration
Swift
case method(cls: AnyClass, sel: Selector, replacement: UnsafeMutableRawPointer, saveOrig: SaveOrig)
-
A function hook.
replacement
should be a@convention(c)
function with the same signature as the function which is to be hooked.saveOrig
is a closure which will be passed the original function implementation when the hook is applied.Declaration