Recently found in the development of a lot of third-party libraries used in the project, but the third-party updates when the local can not be updated in a timely manner. However, Cocoapods can manage updates to third-party dependent packages, which will save a lot of time, as described below for the installation and use of Cocoapods
Installation of 1.CocoaPods
1.0.0. The gem command line in Ruby is generally upgraded as follows:
1.0.1. Cocoapods installation is as simple as this:
$ sudo gem install Cocoapods
$ pod Setup
Note: When pod setup executes, it will output setting up CocoaPods master repo, wait a long time, use CD ~/.cocoapods to enter this directory, and then use DU-SH * To view the download progress
Use of 2.CocoaPods
2.0.0. Find the third-party library you want to manage, such as AFN, enter the following command line:
$ pod Search AFN
2.0.1.: Enter the project directory of your choice, then create a Podfile folder and enter the name of the dependent library in the folder:
$ cd Project folder path
$ vim Podfile
Note: Vim is entered in the edit state, enter the following command, then press ESC to save, and then enter: Wq Write and exit
2.0.2.: Place the edited Podfile file in the project root directory and execute the following command:
$ pod Install
Note: Cocoapods the generated *.xcworkspace file to open the project, not the previous *.xcodeproj file, and each time you change the Podfile file, you need to re-execute a The secondary pod Update command ....
IOS Cocoapods automatically manage third-party open source libraries