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

XCFramework support #464

Open
hhrvoic opened this issue Jun 20, 2022 · 5 comments
Open

XCFramework support #464

hhrvoic opened this issue Jun 20, 2022 · 5 comments

Comments

@hhrvoic
Copy link

hhrvoic commented Jun 20, 2022

When exporting this library as a .xcframework users will get errors inside inside .swiftinterface file when including it in the project:

image

The name of the type/class (CocoaMQTT) and the module (CocoaMQTT) are the same so they clash in the .swiftinterface file. Compiler thinks that all the types are under CocoaMQTT class, not under the CocoaMQTT module => limitation where if a module and a type have the same name, as usage is assumed to be the type first. One of the simpler ways of avoiding this is to rename the CocoaMQTT class to something else. This would however be the breaking change.

Similar issue: parse-community/Parse-SDK-iOS-OSX#1601

@leeway1208
Copy link
Collaborator

Hi, I guess you want to call swift method in OC language?

@hhrvoic
Copy link
Author

hhrvoic commented Jun 30, 2022

Hi, no, using CocoaMQTT in Swift project, the issue is when you want to export this library as a .xcframework and embed it as such in the project. These ⬆️ are the errors that pop up since the class name (CocoaMQTT) is the same as the library name (CocoaMQTT).

@leeway1208
Copy link
Collaborator

I think the quickest way is change the class name from (CocoaMQTT) to (project)CocoaMQTT or something else.

@hhrvoic
Copy link
Author

hhrvoic commented Jul 15, 2022

Yeah, not sure about naming conventions on this project so I guess it's anything that works :)
I see there is a CocoaMQTT5 class for the v5 of the protocol, maybe the original one which is used for the 3.1.1. could be renamed the CocoaMQTT3?

@hhrvoic
Copy link
Author

hhrvoic commented Jul 6, 2023

This is also now represented as a warning in Xcode.
swiftlang/swift#56573

Screenshot 2023-07-06 at 15 50 53

Any plans with this?

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