Search code examples
iosswiftmqttios-frameworks

How to add Framework containing pods into another project


I am facing a problem and searched for it a lot but did not found any solution.

I had created a Swift framework that uses MQTTKit" that I added to my Framework using CocoaPods.

Now I had created a sample app that will use the above framework.

Then I created a workspace and added the xcodeproj file of framework as well as sample app to the workspace.

But now I am not able to use that framework in my sample app.

I am getting the error No such module MQTTKit inside my framework.

However there is no error in the framework if I build it separately?

So is there is any problem with the pods or something else?


Solution

  • Hey I found another way of doing the above thing.
    What we can do is instead of using cocoapods we can add the frameworks manually in our own framework.
    Since cocoa pods is not playing well with embedded framework as mentioned in the following link.
    http://samwize.com/2015/01/26/projects-workspace-embedded-framework-and-cocoapods/.
    So I did the same things added the frameworks manually in my framework then I added the framework as a subproject in my app.
    Now it is working fine.