You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before Interposing <InterposeTests.TestClass: 0x7fa0b160c1e0>
48
-
Calling sayHi
49
-
After Interposing <InterposeTests.TestClass: 0x7fa0b160c1e0>
50
-
Hi there 👋 and Interpose
51
-
```
52
-
53
15
## Object Hooking
54
16
55
17
InterposeKit can hook classes and object. Class hooking is similar to swizzling, but object-based hooking offers a variety of new ways to set hooks. This is achieved via creating a dynamic subclass at runtime.
// Retrieve the original result and add 1 to it. This can be skipped.
106
+
return hook.original(`class`, hook.selector) +1
107
+
}
108
+
}
109
+
110
+
print(MyClass.getStaticValue()) // => 43
111
+
112
+
try hook.revert()
113
+
print(MyClass.getStaticValue()) // => 42
114
+
```
63
115
64
116
### Object Hook
65
117
66
118
…
67
119
120
+
### More Examples
121
+
122
+
You can check out the extensive test suite to see more advanced examples or the example Xcode project to see more real-life examples of tweaking AppKit classes.
123
+
68
124
## What’s Changed
69
125
70
126
Compared to the [original implementation](https://github.com/steipete/InterposeKit), this fork introduces several API and internal changes. Here is a summary of key differences with migration hints.
0 commit comments