Cocoapods is a common tool used by iOS to manage third-party class libraries. However, it was found that many articles on the Web were installed directly using Ruby and needed to modify the image. So this article speaks directly about using brew to install Cocoapods.
1, Installation homebrew:
If you have already installed homebrew, you can skip it.
Homebrew is a software package management tool under a Mac system. Can quickly install software that is commonly used under MAC systems
Execute the following command to install homebrew:
Ruby-e "$ (Curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install)"
2. Use Brew to install Cocoapods
Execute the following command:
Brew Install Cocoapods
3. Using Cocoapods
If you can use it, pass it directly.
A. Use the Cocoapods tool for a Xcode project:
Execute command:pod init
You'll find an extra podfile file.
b, open the podfile. and add a third-party library to the pod import in the Podfile file.
You can also use Vim to quickly edit.
:
C. Save the Podfile file after editing is complete:
Execute the following command to install a third-party library:
Pod Install
Mac uses brew to install Cocopods