Introduced:
iOS development, in most cases, we need to integrate some third-party dependent libraries, for a slightly larger project, the number of third-party dependent libraries is also very impressive. Cocoapods is a objective-c third-party Library management tool that facilitates the management of third-party libraries.
Usage: 1. Installation
$ sudo gem install Cocoapods
2. Usage
在iOS项目目录下新建Podfile
Files, add third-party dependent libraries, such as
SOURCE ' Https://github.com/CocoaPods/Specs.git ' Platform:ios, ' 8.0 ' pod ' afnetworking ', ' ~> 2.0 ' pod ' aranalytics ', ' ~> 2.7 '
How to find a third-party library, such as I want to find Mknetworkkit, Run command at terminal
Pod Search Mknetworkkit
We can add in the Podfile file
Add directly
Pod ' Mknetworkkit '
Automatically loading the latest library, it is recommended to use a stable version number, if the latest dependent library modification method or instability, your project will not run, unless you need the latest dependent library features.
CD to Podfile directory, run
Pod Install
If you need to update a dependent library, run
Pod Update
3. Running
Under Project directory, open (project name). Xcworkspace
Here, third-party dependent libraries are automatically loaded into the project, good luck!
4. Project submission to Git
Add in a. gitignore file
# podpods/
This ignores the dependency library and streamlines the GIT library. Other people just need to update the dependent library to be local.
Reference:
1. http://cocoapods.org/
iOS Development Cocoapods (objective-c third-party library management tools)