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

Add @objc annotation for main classes and functions. #87

Open
7va opened this issue May 23, 2023 · 1 comment
Open

Add @objc annotation for main classes and functions. #87

7va opened this issue May 23, 2023 · 1 comment

Comments

@7va
Copy link

7va commented May 23, 2023

Hello!

While Swift is generally considered to be a superior option, it may still be necessary to maintain compatibility with older projects written in Obj-C, Unity-generated projects, and KMM. To achieve this, it would be advisable to annotate all public classes and functions with the @objc annotation.

@antonselyanin
Copy link
Contributor

Unfortunately, you can't just add @objc annotations to public APIs and achieve Objective C compatibility. It doesn't work with Swift structs, for instance.

In my opinion, a better way would be to wrap the existing API with objc-compatible layer, preferably as a separate package/library.

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

2 participants