Cocoapods third-party class library dependency management

Source: Internet
Author: User
Tags install cocoapods

Install Cocoapods 1. Remove Ruby's source address gem sources--remove HTTPS://RUBYGEMS.ORG/2. Add Ruby's Source address gem sources-a https://ruby.taobao.org/ Xcode7 recommends using the HTTPS protocol 3. View Ruby's Source address gem sources-l 4. Installing Cocoapodssudo gem install cocoapods//Note: sudo for administrator privileges, so you need to enter a password, When you enter a password, the cursor does not prompt//CD to access the file//ls view the file in the current folder//pwd get the current file path//cocoapods requires a minimum version of Ruby 1.9.3, if required upgrade need to review the following Ruby upgrade 5. If you are prompted that the gem version is too low, Need to upgrade Gemsudo gem Update--system 6. Test the success of the Cocoapods installation pod search afnetworking//Note: afnetworking is a third-party name, can be replaced by other, and support fuzzy search/ /If not installed successfully, prompt setting up CocoaPods Master Repo//cocoapods installation with two steps: a.cocoapods environment installation B.cocoapods Main Branch Creation (equivalent to checkout from the Cocoapods server to your computer) after the installation we also want to test whether we can use 1. or in the terminal step by step 2 Save this step in saving the Podfile file, and exit (press ESC to save the exit) For example: Wq (to press ESC again, press W and then press Q to proceed to the next step) use Cocoapods 1. Create a Project 2. On the command line CD Project home Directory folder for example: Cd/users/fuxiaohui/de Sktop/lessoncocoapods 3. Create a file named Podfile for example: Vim Podfile 4. Write the third-party class library you want to add in Podfile, using pod search * To search for the third-party class library You're looking for, such as:

Platform:ios, ' 6.1 '
Pod ' afnetworking '
Pod ' Sdwebimage '
Pod ' Mjrefresh '

5. Save the Podfile file and exit (press ESC to save exit) For example: Wq 6. Installing a third-party class library For example: Pod install

7: Use in engineering

directly in the project. M tap #import <AFNetworking.h> can be found ~

Cocoapods third-party class library dependency management

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.