How can I build on top of an XCArchive file? - ios

I have a client which is delivering me an XCArchive file to be used as the base layer of a project. I am to extend the base classes and add customization. How can I use an XCArchive file in my project? Is there any way to convert or extract a precompiled library (.a) or attach as a framework somehow, add it as a target, ect...
Not sure where to begin on this one.

Ask for the whole project. Not just the archive file.
The archive does not contain app's source code

Related

Does an iOS extension have an IPA file?

I was wondering if a share extension creates an .ipa file similarly to a regular target?
Thanks
No, it's packaged in your app's IPA and delivered to Apple as a single file with it (and everything else).
An IPA itself is a zip format file -- if you make a copy of one and rename it to .zip, you can unzip it and look at what it has.
At the top level it has a Payload folder with a .app file in it. That file is a package (you can right-click and show contents). In there, you'll find a PlugIns folder, which will have *.appex files. These are what your extension targets build.
So, the IPA's Payload/NAME.app/PlugIns/*.appex packages are the extensions.

Add .ipa file as library in a xcode project

I created a project and generated its .ipa file. Now I want to link this .ipa file as library into other project. Is it possible to do it? If yes how can I achieve this?
Please help me..
an .ipa file as a library? no... you can't do that. An .ipa file is essentially a .zip file containing the application binary and resources (compressed or not). There's nothing exposed that whatever you're trying to do can hook into.
Use a static .a library or a dynamic .dylib or a framework to expose functionality from another project for use somewhere else.
You can never add a .ipa into a project. If you want to use some functionality from the project then create a static library (.a) out of the code and you can use it in any project. Or if you want you can create a framework .
EDITED : Use this URL. Its a nice tutorial http://www.raywenderlich.com/65964/create-a-framework-for-ios

Deploying static library in Xcode 6

I want to deploy a static library that I've been writing in Xcode 6. I've already managed to compile the library into a .a file. Now I want to use it in another project. Also, note that including the library project is not an option, as this library is supposed to be distributed in binary.
I also managed to import the .a file into a new project, but I'm not sure what the best way to find the header files is. Should I copy them to a system folder? Should I just link to the framework's (downloaded) folder? Should I import the headers directly in the project? As the framework is meant for distribution, I think that ideally I would copy them to a system folder.
Finally, I've read that I need to build two different versions if I want the framework to be compatible with both iOS and the simulator. Is this true? Can it not be distributed in the same binary?
I distribute such a library for my company. I essentially put the .a file (built up with lipo) into a folder along with the headers. The client then needs to add the .a file to their project in the Build phases, Link Binary With Libraries. Then, they should add the path to the header files using a project relative path to the "User Header Search Paths". From my readme:
Process to Add the SDK to Your Project
1) Copy the xxx folder to the app folder, which contains the
".xcodeproj" project file, then add the directory to your project,
but don't add it to any targets (unselect the checkbox).
2) Add the appropriate library (iOS 6.0 or 7.0) folder, by going to your target's Build Phase tab, Link Binary with Libraries, tap
on "+", then navigate to the appropriate folder and select
libXXX.a
3) Add the following to the Project's Build Settings:
Search Paths -> Library Search Paths:
$PROJECT_DIR/xxx/ios // I have multiple folders each with a lib
Search Paths -> User Header Search Paths: $PROJECT_DIR/xxx
Linking -> Other Link Flags: -ObjC NOTE: If you fail to do this, your app will crash on launch (if it uses categories)
I use lipo to add both the Simulator .a files too - even thought this is not officially sanctioned. As others have said, Apple frowns on this yet offers no easy way for users of your library to use different .a files - the "official" solution would be for you to write a custom build script.

Use an entire app as a dependency?

Without going into the why, I need to use an entire app for various classes and libraries it has and includes.
Is there a way I can use the entire project as a dependency? When I choose "static library target" I lose all the hundreds of classes in the "compile" step. Effectively I would like to be able to package the project such that I can use it elsewhere.
Is there an easy way to do this aside from building my new app out of the old app and changing the app name/launch targets?
You have to find a way to transport every element into the new XCode project. iOS app consists of:
main.m file - You probably won't need to copy that, as it's usually just one line.
Source files and headers for: appDelegate, ViewControllers etc. - I don't understand why you would "lose all the hundreds of classes" during compile time. You're the one that chooses what is to be included in the static library. Add all the header files you need to "Copy headers" in the static library target "Build Phases". Add all the source files into "Compile sources". There are many tutorials and StackOverflow posts on how to do that. (example: How can I create static library and can add just .a file on any project in ios)
Storyboards, xib files, *.plist files, images and other resources - you need to put these in a *.bundle file . Just create a new target (which is a bundle) and include all the needed resources in it. Then you'll have to find a way to use them in the new XCode project. For example setting the default *-info.plist or *.pch file: How to tell Xcode where my info.plist and .pch files are or setting the main storyboard.
So you end up with two files: one framework/static library and one bundle file. It shouldn't be that hard to configure new XCode project to use resources from the bundle and classes from the static library.
I'm not sure if I understood your question.
You can add your old app as a project to your workspace and add it as a "target dependency" to use it.
The easiest and safest way to do this is to copy the whole workspace and change the initial view controller.

How to add a .tar library into my project

i use Xcode 4.2 and i need to integrate an external library, obviously, it was taken as compressed file(.tar), so in Xcode, when i add it and try to import its files in my code, they aren't recognized, so the library isn't correctly imported although i see it in my project Groups and Files Panel.
.tar isn't compression, it's an archive. Try unarchiving it and importing the file or files inside the archive.

Resources