7

Currently i am trying to optimize my modulemap. The problem was that i could not add my framework to my project because i used a obj-c Framework in my swift framework. I added the Obc-c headers in my modulemap and made the module work and could successfull add my framework to my project. The problem is that I cant make it work with realative path to my headers. And using absoute path is only a temp solution and not co worker friendly.

Right not I have to set this kinda absolute path:

header "/Users/me/Documents/framework_project/Folder/OBJC_LIB.framework/Headers/someHeader.h"

I added this modulemap in my framework project as private modulemap. Is there any option to my this work like this?

header "./Folder/OBJC_LIB.framework/Headers/someHeader.h"

Thanks in advance.

Offset
  • 529
  • 1
  • 4
  • 20
  • I'm also facing same issue and finally came across your post which is exactly same and sadly still unanswered. @Offset, did you find any solution to this by any chance ? – Tushar May 02 '18 at 01:27
  • Kind of. I somehow made it working but removed the modeulemap and the nested frameworks structure. apple will not support this kind of useage of modulemap. and the chance of breaking this on the next releasse is pretty high. I decided to add all frameworks in a flat in the app. Means no nested frameworks and dirty modulemap useage – Offset May 09 '18 at 11:16
  • Are you using CocoaPods? – Roman Podymov Sep 05 '18 at 14:51

2 Answers2

0

First of all you need to clarify the location of your modulemap file. Probably it will be in the DerivedData folder (to see the location of this folder press Xcode -> Preferences -> Locations in Xcode 10), path will be similar to /Users/me/Library/Developer/Xcode/DerivedData. In such case you will find the modulemap file inside this folder, full path will be something like /Users/me/Library/Developer/Xcode/DerivedData/framework_project_something/Build/Products/Debug-iphonesimulator/framework_project/framework_project.framework/Modules/module.modulemap. Once you will find this file you will be able to use such declaration inside your modulemap file:

header "../../../../../../../../../../../Documents/framework_project/Folder/OBJC_LIB.framework/Headers/someHeader.h"

I know that this is not exactly what you want but maybe it will help you to find a better answer on this question.

Roman Podymov
  • 3,416
  • 3
  • 28
  • 49
0

Having encountered the same problem, I finally found that the HEADER_SEARCH_PATH of the Swift framework must contain the path to the ObjC framework's umbrella header.

Guillaume Laurent
  • 1,626
  • 14
  • 11