7

In regards to a "dynamic framework" target, I need to bridge internal (private) objective-c headers to my swift counterparts.

From my understanding I need to use a private module.

Some of these swift counterparts are bridged back to objective-c using the @objc class TheClass syntax.

I've gone ahead and created a module.modulemap and a module.private.modulemap file in a directory under $SRCROOT and added the "necessary" flags to the build settings.

SWIFT_INCLUDE_PATHS =>$(SRCROOT)/... 

I've also tried adding a "Private module map file" to the build settings

My module map file is:

module InnerModule { export * } 

and the private module file is:

explicit module InnerModule.Private { header "../Classes/Header1.h" header "../Classes/Header2.h" ... export * // and have tried without it } 

In all of the relevant Swift files I've added

import InnerModule.Private 

Now when building the project I get an error in my swift bridge header

#import <MyFramework/MyFramework-Swift.h> // getting an error here MyFramework-Swift.h // generated header file @import UIKit; @import ObjectiveC; @import InnerModule.Private; Module InnerModule not found 

How can this be fixed?

2
  • Any luck finding a solution? Commented Feb 20, 2016 at 15:43
  • No! Tried a lot of variations of the documetnation in LLDB but nothing works for me. Commented Feb 23, 2016 at 11:27

1 Answer 1

1

Turns out that after you compile the framework you can go to the framework header, delete all the "private" headers you don't want to expose.

After that you can delete all of the header files you don't want to expose from the "Headers" directory.

Works as expected

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.