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

Mixed project swift and objc #9

Open
mauron85 opened this issue Jun 16, 2016 · 5 comments
Open

Mixed project swift and objc #9

mauron85 opened this issue Jun 16, 2016 · 5 comments

Comments

@mauron85
Copy link

Hi. Great plugin. However I have problem with my mixed project where I'am using switft and objc. Bridging header is generated fine by this plugin, but somehow "ProductModuleName-header" for objc is not. I'll get compilation error:

fatal error: 'CDVUniversalGeolocation-Swift.h' file not found

Taking excerpt from apple docs related to this:

Import the Swift code from that target into any Objective-C .m file within that target using this syntax and substituting the appropriate name:

import "ProductModuleName-Swift.h"

@mauron85
Copy link
Author

Ok, maybe I know reason. Plugin I'am developing in Swift is in one of the .m files importing autogenerated ProductModuleName-Swift.h header. That is fine. But the problem is that ProductModuleName should be not name of plugin module, but actual application which is using the plugin.

@akofman
Copy link
Owner

akofman commented Jun 17, 2016

Hello,

Did you well add your file in your plugin.xml file ?
Like <header-file src="path/to/ProductModuleName-Swift.h"/>.

mauron85 added a commit to mauron85/cordova-plugin-add-swift-support that referenced this issue Jun 17, 2016
@mauron85
Copy link
Author

It would not help. ProductModuleName depends on the name of App not plugin and as such is not know in advance. In other words when your swift plugin ProductModuleName is CDVMySwiftPlugin and you install it into your CoolCDVApp, then header has to import CoolCDVApp not CDVMySwiftPlugin

@mauron85
Copy link
Author

Also to clarify bit more. This is all about exposing swift classes to objc. The other way round was already handled by this plugin.

@akofman
Copy link
Owner

akofman commented Jun 22, 2016

Hello @mauron85 , Thanks for your PR !
Sorry if I don't have a lot of time this week but I will deep into asap.
I'm not sure to understand well the need just reading your comments. If you have a mixed project demonstrating the compilation error, that would help ;)

mircoservices pushed a commit to mircoservices/cordova-plugin-add-swift-support that referenced this issue Mar 1, 2017
mircoservices added a commit to mircoservices/cordova-plugin-add-swift-support that referenced this issue Mar 1, 2017
mircoservices added a commit to mircoservices/cordova-plugin-add-swift-support that referenced this issue Mar 1, 2017
mircoservices added a commit to mircoservices/cordova-plugin-add-swift-support that referenced this issue Mar 1, 2017
mircoservices added a commit to mircoservices/cordova-plugin-add-swift-support that referenced this issue Mar 1, 2017
mircoservices added a commit to mircoservices/cordova-plugin-add-swift-support that referenced this issue Mar 1, 2017
mircoservices added a commit to mircoservices/cordova-plugin-add-swift-support that referenced this issue Mar 1, 2017
mircoservices added a commit to mircoservices/cordova-plugin-add-swift-support that referenced this issue Aug 12, 2017
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