Skip to content

Commit 1fe3232

Browse files
committed
README: Initial take on Q&A section
1 parent 569c1eb commit 1fe3232

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

README-legacy.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,9 @@ UIKit and AppKit won't go away, and the bugs won't go away either. I see this as
2929
### Can I ship this?
3030
Yes, absolutely. The goal for this one project is a simple library that doesn't try to be too smart. I did this in [Aspects](https://github.com/steipete/Aspects) and while I loved this to no end, it's problematic and can cause side-effects with other code that tries to be clever. InterposeKit is boring, so you don't have to worry about conditions like "We added New Relic to our app and now [your thing crashes](https://github.com/steipete/Aspects/issues/21)".
3131

32-
### It does not do X!
33-
Pull Requests welcome! You might wanna open a draft before to lay out what you plan, I want to keep the feature-set minimal so it stays simple and no-magic.
34-
35-
## Installation
36-
37-
Building InterposeKit requires Xcode 15+ or a Swift 5.9+ toolchain with the Swift Package Manager.
38-
39-
### Swift Package Manager
40-
41-
Add `.package(url: "https://github.com/steipete/InterposeKit.git", from: "0.0.1")` to your
42-
`Package.swift` file's `dependencies`.
43-
4432
## Improvement Ideas
4533

4634
- Write proposal to allow to [convert the calling convention of existing types](https://twitter.com/steipete/status/1266799174563041282?s=21).
4735
- Use the C block struct to perform type checking between Method type and C type (I do that in [Aspects library](https://github.com/steipete/Aspects)), it's still a runtime crash but could be at hook time, not when we call it.
4836
- Add a way to get all current hooks from an object/class.
49-
- Add a way to revert hooks without super helper.
50-
- Add a way to apply multiple hooks to classes
51-
- Enable hooking of class methods.
52-
- Add [dyld_dynamic_interpose](https://twitter.com/steipete/status/1258482647933870080) to hook pure C functions
53-
- Combine Promise-API for `Interpose.whenAvailable` for better error bubbling.
54-
- Experiment with [Swift function hooking](https://github.com/rodionovd/SWRoute/wiki/Function-hooking-in-Swift)? ⚡️
55-
- Test against Swift Nightly as Cron Job
5637
- Switch to Trampolines to manage cases where other code overrides super, so we end up with a super call that's [not on top of the class hierarchy](https://github.com/steipete/InterposeKit/pull/15#discussion_r439871752).

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,22 @@ Compared to the [original implementation](https://github.com/steipete/InterposeK
152152
- Fixed a crash where `IKTAddSuperImplementationToClass` was stripped in release builds per [steipete/InterposeKit#29](https://github.com/steipete/InterposeKit/issues/29) by using the fix from [steipete/InterposeKit#30](https://github.com/steipete/InterposeKit/issues/30) submitted by @Thomvis, which replaces a call via dynamic library with a direct Swift call to `IKTSuperBuilder.addSuperInstanceMethod(to:selector:)`.
153153
- Fixed floating-point register handling on arm64 using the patch from [steipete/InterposeKit#37](https://github.com/steipete/InterposeKit/issues/37) submitted by @ishutinvv, which resolves an issue affecting swizzled methods with `CGFloat` parameters or structs like `CGPoint` and `CGRect` due to floating-point registers not being restored in the correct order after the trampoline call.
154154

155+
## Q&A
156+
157+
### Why did Peter call it InterposeKit?
158+
### Why another Objective-C swizzling library?
159+
### Can I hook pure C functions or Swift methods?
160+
161+
No. Peter had plans to experiment with [Swift method hooking](https://github.com/rodionovd/SWRoute) and hooking C functions via [`dyld_dynamic_interpose`](https://twitter.com/steipete/status/1258482647933870080), but neither made it into the library. And honestly, it doesn’t really fit the scope of this library anyway.
162+
163+
### What the fork?
164+
### Can I ship this?
165+
166+
## Improvement Ideas
167+
168+
- Signature type checking at hook construction
169+
- Add support for reverting multiple hooks on a class in arbitrary order
170+
155171
## References
156172

157173
- [Peter’s original implementation](https://github.com/steipete/InterposeKit)

0 commit comments

Comments
 (0)