I'm creating my own iOS framework for use in one of my apps. Now I want to send the app to a friend so that he can run it. I want this to be as simple as possible for him, and I don't want him to have to change of the build settings or link the framework. Given that I don't know what directory he will place the framework in, I think I have 2 options:
1.
When I drag the framework into my app, I don't "copy" the framework, and instead just keep a reference to it. Furthermore, I place my framework in a directory called Project. Then the directory would look like this
/Project
App
Framework
This way, I can send the Project file, and when he runs the app the reference to the framework will be the same.
2. Copy the framework into the project, and just send the app.
Do both of these methods work the same?
Both methods should work. Reference to a file is kept in the project, and file is in the project directory. But, for example, if framework file was placed outside the project directory, it wouldn't work.
Related
In my experiments, I build without problems, but no matter what I do, I need to add both frameworks to the client project. So is there any way to make it into Single framework?
So I dont want add the subframework, I want to add only the last framework that I created in client project.
I added sub-framework inside the main framework , it builds ok.
In my client project;
And;
But inside client project,it says "missing required module "MySubframework".
It is finding it in my own computer because I compile it, but when I send main framework another place it says that.
I have an iOS project with common functionality (including FB Crashlytics logging) included in several other iOS projects each with their own GoogleService-Info.plist file.
Everything seemed to work fine until it came to adding the "Firebase/FirebaseCrashlytics/run" Run Script phase to the common project at which point I find I need to pass in the correct GoogleService-Info.plist file (via /FirebaseCrashlytics/upload-symbols).
Is there a way to do this, perhaps some way to detect the project containing the common project and set the correct path to the appropriate GS-I.plist file, or will I have to move all FB functionality into the separate projects?
In the end, I put the Run Script into my separate projects but referenced the FB path in the common project, e.g.
"../CommonProject/Firebase/FirebaseCrashlytics/run"
I assume this will work (there's no errors on compilation, obviously) but have yet to confirm FB logging, etc... occurs.
I have my own framework which I've made. I use this framework in another project I made. That is, after building my framework, Dragged the Product, .framework to Embedded Binaries of project.
However, I've to continuously make changes to the framework. So the process of dragging and dropping again and again is a lot of work. How to conquer this ?
Can someone tell the exact steps even if it means including the project as well ?
Copy the framework Project to your project folder.
Open your Project in xcode.
Right click on the Project File on left side of xcode and click on option "Add file to Project Name" and then select the framework project here.
Delete the Product .framework available in the embedded libraries and add the framework product properly.
So your goal is to 'deploy' changes made to .framework to all the projects you've already embedded it in previously. Here is one approach to it.
Create [myFramework]Targets.txt file where you'll be putting all the locations (directories) of your framework in different projects, line by line. It will have something like this:
~/Path/to/project/A/Frameworks
~/Path/to/project/B/Frameworks
~/Path/to/project/C/Frameworks
Create deploy_framework.sh file with script that will replace your framework everywhere you need. I'm definitely not the one you can call a Bash expert, by here is what it probably looks like:
for destination in $(<[myFramework]Targets.txt); do /bin/cp -rf /Path/to/updated/[myFramework].framework "$destination"; done
Now, whenever you're done with your framework changes, just run deploy_framework.sh from Terminal. Assuming your Xcode projects have existing reference to .framework and you didn't change its name, it should work.
NOTE: You might still need to do Clean+Build for your projects to compile with updated framework. I believe you can also tweak project settings to 'cache' builds less aggressively.
Let me know if it works for you, we might need to adjust script a bit, since I never tested it.
I have a scenario where I need to package some common code into a Swift only framework. I have found many tutorials on how to do this but all involve creating a framework within an iOS app. My goal is to:
Create a seperate Framework project
Build and produce a .framework file
Copy that single file(without all the source files) into some iOS app project, add it under "Linked Libraries" and use it.
Question: Is this possible or do I have to include all of the Classes that are part of the framework?
I have added a framework project to an iOS app and had success using it because all the source code was in the Framework project. I tried to copy that .framework file alone to a new project and use it but when trying to access the classes or instantiate the contents of the framework I couldn't even-though whatever needed to be declared as public was.
Appreciate any help...
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.