@@ -22,7 +22,6 @@ Compare: [Swizzling a property without helper and with InterposeKit](https://gis
2222Let's say you want to amend ` sayHi ` from ` TestClass ` :
2323
2424``` swift
25-
2625class TestClass : NSObject {
2726 // Functions need to be marked as `@objc dynamic` or written in Objective-C.
2827 @objc dynamic func sayHi () -> String {
@@ -37,10 +36,9 @@ let interposer = try Interpose(TestClass.self) {
3736 methodSignature : (@convention (c) (AnyObject , Selector) -> String ).self ,
3837 hookSignature : (@convention (block) (AnyObject ) -> String ).self ) {
3938 store in { `self ` in
40-
41- // You're free to skip calling the original implementation.
39+
4240 print (" Before Interposing \( `self ` ) " )
43- let string = store.original (`self `, store.selector )
41+ let string = store.original (`self `, store.selector ) // free to skip
4442 print (" After Interposing \( `self ` ) " )
4543
4644 return string + " and Interpose"
@@ -50,8 +48,11 @@ let interposer = try Interpose(TestClass.self) {
5048
5149// Don't need the hook anymore? Undo is built-in!
5250interposer.revert ()
51+ ```
5352
54- // Want to hook just a single instance? No problem!
53+ Want to hook just a single instance? No problem!
54+
55+ ```
5556let hook = try testObj.hook(
5657 #selector(TestClass.sayHi),
5758 methodSignature: (@convention(c) (AnyObject, Selector) -> String).self,
0 commit comments