20

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

0

1 Answer 1

25
+50

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

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

6 Comments

I'm afraid I am aware of that, but my question is more about how I can import the .framework without having to drag it into my xcode project. In the same way I can import SpriteKit without having to drag the .framework into my project. Thank you for your answer though.
In a scenario where you want to use an apple framework lets say CoreMotion or UIKit, if have to use import UIKit. It is already available for you to import without have to do anything. Open a new project and import any apple framework without having to do anything. My question is can I have this same functionality so that I don't have to move my framework into every xcode project.
Ohhhhhhhhh sorry man. You need to either add your project to the default library search path or add the library's directory to the default search path list. I'm away from the office mac now. I can find it tomorrow if you don't find it before then.
I was digging around and I found /Library/Frameworks. That is populated with .framework files that may help you. I didn't spot any way to do precisely what you are looking for. If you figure it out let me know. Sorry I couldn't be more help
@Ven: How were you able to make this work with the provided answer? Your comments are a bit contradictory, which is somewhat confusing. Would you please edit the answer or your question and add the solution that you came up with (since the answer you marked as correct didn't appear to have the solution?). Ajwhiteway wanted to know, and it would also help others I think as well, thanks.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.