mixed-swift-objc-framework icon indicating copy to clipboard operation
mixed-swift-objc-framework copied to clipboard

Redefinition of module 'FooPrivate'

Open trispo opened this issue 10 years ago • 9 comments
trafficstars

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

trispo avatar May 06 '15 14:05 trispo

Hi,

I'm having the same problem. Did you find a solution yet, @trispo?

Kind regards, Rugen

rugheid avatar May 29 '15 13:05 rugheid

Hi, I don't use the Foo.private.modulemap and this works for me. Do you think this is a problem?

Gunnar

trispo avatar May 30 '15 07:05 trispo

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

rugheid avatar May 30 '15 10:05 rugheid

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

antonioromano avatar Jul 23 '15 11:07 antonioromano

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.

danieleggert avatar Jul 23 '15 13:07 danieleggert

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

antonioromano avatar Jul 23 '15 13:07 antonioromano

got it working by making the two modules different. Rename the module 'module.modulemap' to FooPrivates. check out here

LuAndreCast avatar Jul 20 '16 16:07 LuAndreCast

@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 ?

deepesh259nitk avatar May 03 '18 21:05 deepesh259nitk

@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.

userException avatar Feb 21 '20 17:02 userException