1

I have built a iOS app which requires a library files. I have created them (static libraries .a extension files), there are actually projects also which I want to include them to my project.

What is the good procedure to follow.

  1. Do we need to include the projects with in our projects as library & make just reference path(make an external reference) to them or Directly include them to our project folder.

  2. If we include the project will the size of the existing project build file increases.

Thanks

Nithin Michael
  • 2,166
  • 11
  • 32
  • 56
Srivathsava K
  • 437
  • 2
  • 5
  • 15

3 Answers3

1

If I were you I would include them and made sure I checked "copy to destination folder", so the project is complete and transferable, and can compiled non-locally as well.

Mathijs
  • 1,258
  • 1
  • 10
  • 27
  • The thing is I use this library for many other projects, So I was just making it as reference and not add to the destination option. – Srivathsava K Dec 16 '13 at 05:04
1

This will explain including libraries into existing project. Have a look at that. Hope it will help you.

Community
  • 1
  • 1
Nithin Michael
  • 2,166
  • 11
  • 32
  • 56
  • The shared link is fine. But the library I use is used for multiple projects, I'm just selecting reference to the Project & not copy to the destination option. which option is recommended. – Srivathsava K Dec 16 '13 at 05:09
  • As Mathijs said copying to destination folder is better one. So that its will be transferable. Otherwise if u run it in other machine you need to do these again to avoid the errors. – Nithin Michael Dec 16 '13 at 06:06
1

My favorite method is to use cocoa pods. Cocoa pods keeps your libraries up to date from their corresponding github projects. Go to the cocoa pods site for details. But the outline of the steps is:

  1. Install the cocoa pods ruby gem
  2. Add a library dependency file into your proyect. The "Podfile"
  3. run "pod install" to install the proyect. This will create a ".xcworkspace" that you will use on xcode instead of your ".xcodeproj".

Cocoa pods will download the library and integrate it to your xcode workspace. If is not perfect but I have found it to be the best way to maintain your external dependencies.

For this to work the library you anre including must have been made a "pod". That means having a podspec file in a publicly accesible URL. Most relevant Objective-C open source libraries have one.

fsaint
  • 8,759
  • 3
  • 36
  • 48