ObjectHook

final public class ObjectHook<MethodSignature, HookSignature> : TypedHook<MethodSignature, HookSignature>
extension Interpose.ObjectHook: CustomDebugStringConvertible

A hook to an instance method of a single object, stores both the original and new implementation. Think about: Multiple hooks for one object

  • The object that is being hooked.

    Declaration

    Swift

    public let object: AnyObject
  • Initialize a new hook to interpose an instance method.

    Declaration

    Swift

    public init(object: AnyObject, selector: Selector,
                implementation: (ObjectHook<MethodSignature, HookSignature>) -> HookSignature?) throws
  • The original implementation of the hook. Might be looked up at runtime. Do not cache this.

    Declaration

    Swift

    public override var original: MethodSignature { get }
  • Declaration

    Swift

    public var debugDescription: String { get }