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

Expose to Objective C #133

Open
Logikgate opened this issue Jan 3, 2020 · 3 comments
Open

Expose to Objective C #133

Logikgate opened this issue Jan 3, 2020 · 3 comments

Comments

@Logikgate
Copy link

I have a project that requires me to consume all pods with Objective C. Since Swift >= 4 requires the explicit setting of the @objc attribute to expose Swift methods to Objective C I'm currently unable to use EventSource unless I maintain my own fork with the attributes added.

Would you be open to a pull request that adds the @objc attribute to the methods of EventSource? I've looked into it and the only method that won't be as simple as adding @objc is onComplete. This is due to its usage of Bool? and Int? in the function definition. For that method I would propose a new wrapper method be created called onCompleteBridged that would be exposed to Objective C and would handle unwrapping the props to Objective C compatible NSNumber?

@tanghk
Copy link

tanghk commented Apr 10, 2021

Hello,
Nicholas Fredricks
I have a project that requires me to use EventSource with Objective C, but I don’t know how to use swift. Can you give me a demo? Regarding the use of EventSource in Objective C. thank you very much my friend

@Logikgate
Copy link
Author

Hi @tanghk you should be able to use this by just adding the below to your PodFile

pod 'IKEventSource', :git => 'https://github.com/flypapertech/EventSource', :branch => 'expose-methods-to-objc'

Then importing it in your project via @import IKEventSource

@tanghk
Copy link

tanghk commented Apr 14, 2021

thank you very very much @Logikgate

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