mixed-swift-objc-framework
mixed-swift-objc-framework copied to clipboard
Redefinition of module 'FooPrivate'
Hey,
thanks for your work on this topic. As of Xcode 6.3 I cannot compile "MyApp" in your example. The compiler fails with "Redefinition of module 'FooPrivate'". In my own project where I use your tips I get exactly the same error when compiling the main application. The compilation of the framework itself succeeds. Do you have suggestions on how to solve this issue?
Thanks Gunnar
Hi,
I'm having the same problem. Did you find a solution yet, @trispo?
Kind regards, Rugen
Hi, I don't use the Foo.private.modulemap and this works for me. Do you think this is a problem?
Gunnar
Hi,
I tried that in my project, but it didn't work. When I tried it in this repo however it did. My project is a Mac framework, maybe that's the problem. Is your framework an iOS framework?
Thanks for your help! Rugen
Any news? I also tried to remove the file Foo.provate.modulemap but didn't work, do i have do change anything else? . I'm working on an iOS Swift framework
This is a big hack… and since Xcode and Swift are continuously being improved upon, it's to be expected that this will stop working. I've found that moving code into smaller (sub-) frameworks it a better solution.
I found today a better (in my opinion) solution. The link is: http://spin.atomicobject.com/2015/02/23/c-libraries-swift/ and on the section Module maps explains how to do it in 2 simple steps. I hope you enjoy it
got it working by making the two modules different. Rename the module 'module.modulemap' to FooPrivates. check out here
@trispo nice work but has anything changed now in xcode 9.3 ? or we just use this same approach to make private headers visible to swift files within a objc framework ?
@LuAndreCast Trying this in 2020, it creates a private headers folder in the framework which has all the Objective-C headers visible outside the framework.