Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can only swizzle functions with @objc keyword #3

Open
TLHorse opened this issue Apr 3, 2020 · 0 comments
Open

Can only swizzle functions with @objc keyword #3

TLHorse opened this issue Apr 3, 2020 · 0 comments

Comments

@TLHorse
Copy link

TLHorse commented Apr 3, 2020

I tried to write a swizzle demo:

  • First, I defined a class which is called MyClass with some functions;
  • Then, I defined another class which is called MyClassHook. In this class with another set of functions;
  • I used functions of MyClassHook to swizzle MyClass.

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?

@TLHorse TLHorse changed the title Can only swizzle functions with @objc propertied Can only swizzle functions with @objc keyword Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant