Can only swizzle functions with @objc keyword
Opened this issue · 0 comments
TLHorse commented
I tried to write a swizzle demo:
- First, I defined a
class
which is calledMyClass
with some functions; - Then, I defined another
class
which is calledMyClassHook
. In this class with another set of functions; - I used functions of
MyClassHook
to swizzleMyClass
.
BUT! The compiler says I must add @objc
keyword at the functions of MyClass
. But I don’t want to do that.
Is there a way that I can avoid this issue?