finding the framework of a cocoa modules - ios

I just followed a tutorial https://medium.com/#PyBaig/build-your-own-cocoa-touch-frameworks-in-swift-d4ea3d1f9ca3 for creating your own cocoa touch framework. There is one step where you need to right click a framework and it shows in finder, but it is not working for me. I can right click any other file and show in finder just fine. Any suggestions on how to find the framework file for dragging into another project?

well according to some apple doc I found:
Note: The standard locations for frameworks are the
/System/Library/Frameworks directory and the /Library/Frameworks
directory on the local system.
If it isn't in those directories, it is probably some custom path that would be specified on the CC line in the build output, and if you were really hard up, you could click the diff editor on the Xcode project and search for something.Framework, where something is the framework you are looking for.
... it is also possible that it is a framework that is build by a sub-project, and for whatever reason, it haven't been built yet.

Related

Xcode import my framework into a project

I've created an objC dynamic framework and I'd like to add it as a dependency into an objC project.
I've read those guides and some SO answers but none of them works:
https://developer.apple.com/library/content/technotes/tn2435/_index.html
http://netsplit.com/xcode-two-apps-with-a-shared-private-framework-in-a-workspace
https://medium.com/swiftworld/my-xcode-project-structure-for-open-source-project-1d363ff48534
https://www.raywenderlich.com/126365/ios-frameworks-tutorial
Basically what I do is open the host app and drag the framework project in it.
Then I drag the framework from the Products group of the framework project into the Embedded binaries section of the sample app.
What I see in the build phases is that I have:
In the target dependencies I can see the framework
In link binary with libraries I can see the framework
It has been added a new phase called Embed framework and my framework is there
If I try to import the framework module the compiler says
Module XXX not found
The only way to make it work seems to add in the framework search path of the build phases, the direct path to the product of the framework itself.
For what I understood it seems that somehow the path of the framework is not taken into account, but as far as I know in none of the guide is written to change it.
[NOTE]: no cocoapods or Carthage solution
Turns out that I had a wrong build settings in Per-configuration Build Products Path, instead of having it to point to build/debug-iphoneos it was pointing just to build .
Thus the process explained in the question works.
Hope this will help someone else.

Adding an Objective-C framework to a Swift XCode project

I know this is a very simple - maybe obvious - question, but I've been struggling with it for a while. I'm working on a SpriteKit project in XCode (using Swift) and I'm trying to add this SKEasing Framework from GitHub.
I've already downloaded and extracted the zip file, and I did everything that 孙博弘 answered including the bridging header (which I made the with the help of this site);
However, the framework doesn't seem to be working. I can't use any of the actions provided by this library. Is there something I'm missing? What am I doing wrong?
You don't add the project to your project.
First open the SKEasing project in xcode by itself. Set the build target to generic iOS device. (With the pop up in the top left corner of the xocde project window.) Then use the Build command (under Product) and when that's done run Archive. There should be a library built now under the products folder (left side of project window). Control click on the library name and select Show in Finder. This will lead you to the library. Copy this file to your project and you should be good to go.
if you use .a, you should use it as follow img.

Trouble with an .h import

As a beginner in ObjectiveC I need some help.
I'm working on a phonegap plugin for IOS (so, written with objective C). I use some open source code but I got an error with an .h import.
My architecture look like:
myFmk.framework/
myFmk.framework/ABCDE/myFmk.h <== in a sub folder
myFmk.framework/myFmk <=== this is a file
myPlugin.h
myPlugin.m
In myPlugin.h I have #import and in "myFmk.framework/myFmk" file I have only one line "ABCDE/".
I thought that this file do a redirection of the absolute import (with brackets) but my complier told me that "myFmk/myFmk.h" is not found.
I tried to find some documentation about this feature but I wasn't able to find its name... do you have this documentation or the feature name?
Thks.
Is the framework added using a cocoapod? If not, did you follow the instructions properly for adding it to your project? It would probably help if you posted the framework you are experiencing problems with.
If this is a framework that is added to your project properly and you are unable to import there are a few things you should check. First, go to your project settings (click on the project at the very top of your file tree in the left column) and then look for "linked libraries". See if the library is listed there. If not click the + and try to add it.
If this framework was added via cocoapods another thing to check is search your file structure for libPods.a. If it is red, I find sometimes it is helpful to delete it, close the project and run pod install again.
Also if you installed the project via cocoapods remember to open the workspace and not the old xcode project file.
I have also experienced this problem when my header search paths and other linker flag paths were wrong. Linker Flags should be $inherited if this is a cocoapod. In my projects most Header search paths are $inherited too.
If none of this is helpful please provide more information such as how this framework was added to your project and what the framework is. Also let us know if you get any error messages.

Importing a third party framework into Xcode 6 – how do I save it to my project?

I'm trying to add the GPUImage library to my project, and I'm following the directions given on the GitHub page to use it with Swift.
I drop the .xcodeproj in, but it appears to just link to where it is in my ~/Downloads folder. How do I add it to my project itself? Where is the proper place to add a framework into a project? Am I even doing it correctly by dragging the xcodeproj into the main xcodeproj of my app?
The way I usually do this is to set up a directory for the framework at the same directory level as your application project (ex: ~/Development/GPUImage, ~/Development/YourProject). I prefer to have the code for the framework outside of the code for my projects for cleanliness of version control, but that's a matter of personal preference.
The instructions for the setup of the framework assume that you already have a set location for your GPUImage code in your filesystem (~/Downloads is probably not that place). Pulling in the .xcodeproj merely links to that location. You'll also need to know that location to set where the framework header search path is.

Xcode: Framework Header File not found - Every time after new launch

Every time i open the project im working on, all header files of the frameworks are not linked. I have to manually add all frameworks reference so that xcode wouldn't give me the error that the header files is not found.
After quitting xcode and launching the project again, same thing.
If anyone could help it would be great ! its a huge pain in the ass tp link binary with libraries of all frameworks every time I launch the project.
Maybe its because of "spaces" in the names of the parent folders of the items that you added.
Check https://stackoverflow.com/a/25009037/1071320
I have tried this way which works for me
Create a group in Xcode
Drag the files inside the SDK to this folder
Build and Go!
N.B what i have tried earlier is drag the whole folder inside the SDK
As #Shumais Ul Haq mentioned. It looks like it is happening because of spaces in the containing folder. When the framework is dragged into the project that spaces are messing in Framework Search Paths. The way to fix it without changing a directory names is to escape a spaces in the framework search path by \ so instead of ../My Directory Name it will be ../My\ Directory\ Name

Resources