Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import my custom module/framework Xcode Swift

Tags:

I want to import my custom module/framework in my Swift project on Xcode 7. I understand how to normally do it. But I don't want to keep dragging and dropping my framework and linking it every time I make a new project. I was thinking I could move the framework to folders in the iPhoneOS.sdk/../Frameworks folder and/or the iPhoneSimulator.sdk/../Frameworks folder. Without dragging or dropping my custom framework into the project, I can import module (with autocomplete). However I get an error "Could not build Objective-C module 'Tumblr'". Is there a Setting in Build Settings I am missing.

enter image description here

**The Tumblr module is a module I created.

I have also created a .tbd and module.map files for the framework existing in the iPhoneOS.sdk

like image 422
Asdrubal Avatar asked Dec 05 '15 00:12

Asdrubal


People also ask

How do I import a swift project into Xcode?

To add a package dependency to your Xcode project, select File > Swift Packages > Add Package Dependency and enter its repository URL.

How do I export a framework in Swift?

Specifying Your Exports FileOpen your project in Xcode. Add your exports file to the project, and place it in the Resources group. Open the framework target's Info window and click Build. Set the Exported Symbols File build setting to the name of your exports file.


1 Answers

Drag your module's x-code project into the left pane with all the files.

Then click on your main project file and go to general, scroll down to Embedded Binaries and add it through the menu there.

enter image description here

like image 66
Ajwhiteway Avatar answered Oct 09 '22 10:10

Ajwhiteway