File tree Expand file tree Collapse file tree 1 file changed +20
-5
lines changed
Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change 11import ObjectiveC
22
33extension NSObject {
4+
5+ public func prepareHook< MethodSignature, HookSignature> (
6+ for selector: Selector ,
7+ methodSignature: MethodSignature . Type ,
8+ hookSignature: HookSignature . Type ,
9+ build: @escaping HookBuilder < MethodSignature , HookSignature >
10+ ) throws -> Hook {
11+ return try Interpose . prepareHook (
12+ on: self ,
13+ for: selector,
14+ methodSignature: methodSignature,
15+ hookSignature: hookSignature,
16+ build: build
17+ )
18+ }
419
520 /// Installs a hook for the specified selector on this object instance.
621 ///
@@ -43,13 +58,13 @@ extension NSObject {
4358 hookSignature: HookSignature . Type ,
4459 build: @escaping HookBuilder < MethodSignature , HookSignature >
4560 ) throws -> Hook {
46- let hook = try Hook (
47- target: . object( self ) ,
48- selector: selector,
61+ try Interpose . applyHook (
62+ on: self ,
63+ for: selector,
64+ methodSignature: methodSignature,
65+ hookSignature: hookSignature,
4966 build: build
5067 )
51- try hook. apply ( )
52- return hook
5368 }
5469
5570}
You can’t perform that action at this time.
0 commit comments