gitignore path to external framework - ios

I have an xcode ios repository which I share with another developer.
In this project we use a framework sdk which is not part of the system so it is referred froms some other directory on our hard disc.
The problem is that the path to this framework is different on each computer so I thought I can just add the path to the external framework to the gitignore file so we do not have to adjust the correct manually every time we pull from github?
Do you see another solution?
Thanks for your help!

Rather than depend on your external framework being present on a developer's computer tu could add it as a submodules to the repository. This has advantages:
the framework is added at a defined path relative to the project.
the version of the framework being used is specified so all developers are using the same version.

Related

Xcode build process for linking & embedding framework to app in workspace

I've separated some functionality in an app I'm working on into a self-contained framework. Both the framework and the app are included in a workspace. How do I include this framework in my build in a machine-agnostic manner?
What I've been doing is adding the framework to the embedded binaries of my client app, as suggested on a number of posts here on SO. This works nicely until you start work on another machine, at which point the randomly generated 'DerivedData' directory the framework resides in can't be found, and you have to re-create the link. This will become a really tiresome process.
I was considering using CocoaPods for this purpose, but unless I'm reading it wrong, you can't just reference local projects with a podspec; the project needs to reside on a known source / repo.
So basically I'd like to know how people here have forged a multi-project build process that isn't linked to the directory structure of a particular development machine.
So I've found a solution that works. The issue was that my client app project referred to the framework file relative to the project itself.
The minimal steps I took to refer to (and embed) my framework were significantly fewer than some of the solutions I've seen.
In my client app's target (on the General tab), add the framework to the 'Embedded Libraries' section. This will also add a reference to the framework to the Project navigator.
Select the reference added to the Project navigator in step 1, and change it's location to be 'Relative to Built Products'. Optionally move the framework to the 'Frameworks' folder of the client app's project, where the rest of the frameworks live.
This second step ensures the build looks for the framework relative to the build products, rather than relative to something else, whose location may vary between machines / copies of the source.
Actually, you can indeed have private Pods. Most tutorials on how to do this usually keep these private Pods within private repos on GitHub, but you can also host them on another Git (non-GitHub) server.
As for the DerivedData directory issue, it sounds like you are including the framework via a build setting (i.e. something like "-framework ~/Library/Developer/Xcode/DerivedData/MyFramework-$$##$###$#/MyFramework.framework").
You should be able to simply click on the "Build Phases" section of your app's target settings and then the "add" (or "+") button and you'll see your (built via the same workspace) framework or library in that list that you can add. More information can be seen in this Apple documentation.

Google Sign In SDK different configuration files for each target

I'm working on an app that has two targets for a lite and a pro version.
We are using Google's Sign In SDK for the authentication which requires a configuration file called "GoogleService-Info.plist".
PROBLEM:
Is there a way to have two different files with the same name and different targets, so each version uses the configuration file required?
Or there is a way to change the configuration file that the SDK uses? I haven't found a way to do this on Google's documentation.
The easiest approach to achieve this, is to create a separate directory in your project folder for each file. After that, you will be able to add both references and assign them to each target with no issues.
Source: BraveS - Copy file to root of XCode project when building

Adding a dependency to a repository with Xcode 6.1

I'm new to programming on iOS and I'm running into a roadblock with adding dependencies to my repository.
When I drag and drop a framework into the project directory and reference everything, I can build the project no problem. The issue is when I commit my project to the repository, the framework files do not get copied over. I can see that they are located in their original directory in some other location. Xcode merely references these files instead of adding them to the project directory.
So my question is, how do you add a framework or dependency to a project directory and commit it alongside your project to your repository?
Note I'm using SVN, however a Version Management System agnostic solution works for me.
In your case, or most cases people just download the framework and add it from there directly though it works in their machines, but will not work in other machine, because of absolute path added to the Header Search Paths settings in Build Settings.
In case of Third Party frameworks are as follows, will work for any case. Add the relative path rather than absolute path, though you don't set it, it is automatically added while you add a framework. So what are the steps? See below
Step 1
Create a folder named framework inside your svn/git folder of your project, and put all the frameworks inside the folder..
Step 2
Now add the framework, from the framework folder as you were doing earlier.
Step 3
Check your Header Search Paths in Build Settings. You will see entry for your framework header path. It should look something like
/Users/username/ProjectFolder/Project/frameworks/myframework/framework.h
Change the above entry by
$(SRCROOT)/frameworks/myframework/framework.h
Doing the above will automatically change this /Users/username/ProjectFolder/Project/ part of your path according to any system you clone the project. And it will work automatically.
Note - Before performing the steps, remove all old Header entries, which has absolute path.
Hope it helps.
Cheers.

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.

Unity: resources.bundle isn't added to xcode

I used to copy/paste my IOS plugin files inside Plugins/IOS folder on my Unity project, but it doesn't work for bundles (as it has directory structure).
I can't beleave there is no way to generate xcode project from unity with .bundle inside?
Any help appreciated
Unity3D will not contains folders in the Plugins/iOS to Xcode project. In fact Unity3D will only auto merge source file and .a library for you, as described by Unity3D's doc:
Automated plugin integration Unity iOS supports automated plugin
integration in a limited way. All files with extensions
.a,.m,.mm,.c,.cpp located in the Assets/Plugins/iOS folder will be
merged into the generated Xcode project automatically. However,
merging is done by symlinking files from Assets/Plugins/iOS to the
final destination, which might affect some workflows. The .h files are
not included in the Xcode project tree, but they appear on the
destination file system, thus allowing compilation of .m/.mm/.c/.cpp
files.
Note: subfolders are currently not supported.
But you can use the PostprocessBuildPlayer attribute to implement this yourself. I made a tool for this purpose called XUPorter, which can make exporting and libraries setting easier from Unity3D to Xcode. You may want to see it on GitHub. There is a demo in the package and you may set your bundle under the 'folders' tag.

Resources