Cocoa Pods
CocoaPods is a tool for managing third - party Open source code in IOS projects
Cocoa uses Ruby to develop its source code on Github
Https://github.com/CocoaPods/CocoaPods
saves time in setting up and updating third-party open source libraries and increases productivity
Tips:
The excellent open source component packages developed using Ruby are mostly managed by RubyGems , such as ROR
RubyGems, referred to as gems. is a Ruby packaging system for Packaging ruby components . It provides a standard format for distributing Ruby programs and libraries, and also provides a tool for managing package installation
installing CocoaPods
Open Terminal
sudo gem install cocoapods
Command explanation: Installing the cocospods toolkit with Gems
pod Setup
Command explanation: Installing the cocospods toolkit with Gems
Tips
Once the CocoaPods is installed, You can use the pod directly in the command line in the future.
Resources
Http://code4app.com/article/cocoapods-install-usage
use of CocoaPods -- find third-party libraries
Open Terminal
Pod Search json
Command explanation: Search the Pods library for third-party frameworks that contain the words "JSON"
The search results will contain:
- Framework main functions
- format in POD configuration file
- Developer Homepage
- Source code warehouse URLs, mostly on Github
- Version history
- Additional accessibility features
Tips
If you are not sure if a frame is available, you can go to Github to see
Basic Use
Create a new project in Xcode
Open Terminal
CD project directory
Pwd
OPEN-E Podfile
Enter things such as the following:
Platform:ios, ' 7.0 '
Pod ' afnetworking '
Save exit, back to Terminal
Pod Install
Command explanation: Install and configure the Xcode project as per the settings in podfile
Tips
Analyzing dependencies( analysis dependent ) process can be very long due to network reasons
Seemingly hard to see the picture ...
Follow-up work
Once added, double- click xxx.xcworkspace to
All related configurations for third-party libraries used in all projects have been completed
Note: When you #import a header file, you need to use the Pods configuration item
#import <AFNetworking.h>
Add or upgrade a third-party library
Edit podfile file
Then open the terminal, go to the project directory and enter the following command
If you upgrade a third-party library, enter:
Pod Update
If you added a new third-party library, enter:
Pod Install
GEM Common commands
Add A source for a gem
Gem sources-a http://ruby.taobao.org/
View gem source
Gem Sources–l
Gem upgrade itself
sudo gem Update–system
View current version
Gem–version
Purge Expired Gems
Gem cleanup
Install package
Gem install Ruby
Uninstalling packages
Gem Uninstall Ruby
Update a locally installed package
Gem Update
List locally installed packages
Gem List
iOS Development Cocoa Pods