Tuesday 27 December 2016

Integrate third party library in an iOS project:


In iOS app development we need many other libraries to be included in our app to accomplish set of task. There are number of ways by which we can include these library  in our project .

1) Using Cocoapods 

Cocoa pod is dependency manager . It is very simple to add library this way . Go to project directory and follow these steps:

a) Run pod init  command
    The above command will initialize the pod in project directory and creates a pod file. 
b) Now open the pod file and add  required library in this file . And save the file .
c) Run pod install command .
    This will install the library in project directory  and creates a xcworkspace  file in project directory .

     From now open the xcworkspace instead of Xcode project . 

2) Manually:

Using this way , we just drag and drop the required files/folder of required library to our project.

3) using git sub module:


Using this way we add a third party project using git command . This command will add third party library as a submodule in our project.

a) Go to your project directory , initialize git if git is not initialized in project directory .
      
     git init 
   
 b) git submodule add  project-url

    The above command will add third party library at given url as a sub module in our project .


No comments:

Post a Comment