1

I'd like to create a dynamic framework in Swift. However, I'm building this framework on top of another dependency called Parse, which is Objective-C based. I've seen various tutorials on how to create a framework in Xcode but none has covered a framework with its own dependency.

I tried to create a framework project and then importing the dependency by import statement

import parse

Since Parse itself is a dependency in the main project, it should be available to my framework as well but unfortunately it throws an error.

No such module 'Parse'

Then I thought to include the bridging header in my framework but then I came to know that bridging headers are not supported inside the framework.

So the question is: is it possible to create a Swift framework on top of Objc dependency in Xcode. And if so, how?

Edit:

I have gone through the suggested post but I am unable to build the project.

What I did now: Included a module.modulemap file inside the Parse folder in framework:

module Parse {
  header "../../../Pods/Parse/Parse/Parse.h"
  export *
}

Result:

'Parse/ParseClientConfiguration.h' file not found

SandeepAggarwal
  • 1,273
  • 3
  • 14
  • 38
  • Possible duplicate of [Import Objective-c framework into Swift framework (Google Analytics + Cocoapod)](https://stackoverflow.com/questions/32149371/import-objective-c-framework-into-swift-framework-google-analytics-cocoapod) – koen Jul 24 '18 at 14:44
  • Did you try adding Parse as a dependency to your own framework? – koen Jul 24 '18 at 15:56
  • No, it is not advised https://stackoverflow.com/a/32922605/3632958 – SandeepAggarwal Jul 24 '18 at 15:57
  • Anyone meet the same problem can check [this](https://stackoverflow.com/questions/47529575/relative-path-for-headers-in-modulemap) out – Hai Hoang Sep 29 '22 at 11:49

0 Answers0