CocoaPods for iOS development (objective-c third-party library management tool)

Source: Internet
Author: User
Tags install cocoapods

CocoaPods for iOS development (objective-c third-party library management tool)
Introduction:

During iOS development, in most cases, we need to integrate some third-party dependent libraries. For a slightly larger project, the number of third-party dependent libraries used is also very large. CocoaPods is an objective-c third-party library management tool to facilitate the management of third-party libraries.

Usage: 1. Install

$ sudo gem install cocoapods

Update cocoaPods

gem update cocoapod

If the gem is not the latest, execute the command

sudo gem update --system

2. Usage

Create a Podfile In the iOS project directoryFile to add third-party dependent libraries, as shown in figure

source 'https://github.com/CocoaPods/Specs.git'platform :ios, '8.0'pod 'AFNetworking', '~> 2.0'pod 'ARAnalytics', '~> 2.7'

 
 

How can I find a third-party library? For example, if I want to find MKNetworkKit, run the command on the terminal.

pod search MKNetworkKit

You can add <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPHA + PC9wPgo8cHJlIGNsYXNzPQ = "brush: java;"> pod 'mknetworkkit', '~> 0.87'

 

Add directly

pod 'MKNetworkKit'

We recommend that you use a stable version number to automatically load the latest database. If the modification method of the latest dependent database is unstable, your project will not run unless you need the latest dependent database features. 

Cd to the Podfile directory and run

pod install

To update the dependent database, run 

pod update

3. Run 

In the project directory, open (project name). xcworkspace

Here, the third-party dependent libraries are automatically loaded into the project, good luck!

4. submit the project to git

Add

# podPods/

In this way, the dependent libraries are ignored and the git libraries are simplified. Others only need to update the dependent database to the local machine.

Refer:

1. http://cocoapods.org/


Related Article

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.