CocoaPods: The most famous class library management tool.
The usual, first a few feel to yourself to learn this helpful blog bar.
--The CSDN above
Cocoapods Installation and Use tutorials
--The Cocoachina above
Manage third-party open source class libraries using Cocoapods
Http://www.cocoachina.com/ios/20140519/8471.html
CocoaPods
The preceding Ruby environment does not say, I summarize a few steps are:
Navigate to your directory Project file:
1. cd/user/***
2. Create a new Podfile file (note case) and write: (If re-open, it should be VI podfile)--see the lower left corner, click the i key (insert)--write (such as:
Platform:ios, ' 7.0 '
Pod "afnetworking", "~> 2.0"
Here's how the parameters are obtained--"(after installing the Cocoapods) Pod Search * * * * * * * * * for the third-party class library you want, for example.
Terminal Input command (preferably specify the project directory to which you want to import the class library) Pod Search masonry
The location of the relevant class library in GitHub is given. If you are importing the first class library, then you are directed to the podfile location of the corresponding Web page according to the GitHub address,
The pod ' masonry ' is the corresponding parameter in the podfile of the door.
Tips: If this class library is the first to import, then it is best to add Platform:ios, ' 7.0 ', which means that the iOS version required for the platform should be >= 7.0.
Return to what has just been said above. After writing the parameters and exiting the VIM environment, execute the Pod install command (still under your project project file).
Tips: Here, perhaps a lot of people will encounter in the updating local specs repositories when stopped, then, some will wait a while to execute, if a two minutes or stop still, then I suggest you, Re-open terminal window--Navigate to project directory--Enter pod install--verbose--no-repo-update command to ignore the cocoapods.org of the wall again.
If you found a third-party class library package in pods under the Project directory folder, congratulations, you've already been able to use Cocoapods to import a third-party class library.
The question is, what should I do if I need to import another third-party library at this time?
1. Navigate to the catalog file.
2. Pod Search * *;
3. Copy Pod ' * * ', ' ~>2.2.2 '
4. Open Podfile---VI podfile in the catalog file
5. Write the pod command above
6.: Wq exit VIM editing environment
7. Execute the pod install--verbose--no-repo-update command and import the third-party library.
IOS Cocoapods Introduction and use and combat