iOS Development Cocoa Pods

Source: Internet
Author: User

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:

    1. Framework main functions
    2. format in POD configuration file
    3. Developer Homepage
    4. Source code warehouse URLs, mostly on Github
    5. Version history
    6. 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

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.