Use of Cocoapods in iOS engineering

Source: Internet
Author: User
Tags install cocoapods

Use Cocoapods to manage third-party libraries in iOS engineering.

Cocoapods can effectively manage third-party libraries, prevent conflicts and keep them up to date.

1. Download and install Cocoapods

Installing cocoapods requires a ruby environment, and now the OS comes with a ruby environment, open terminal input: sudo gem install cocoapods Wait a few minutes (if Ruby environment version is low, need to update Ruby, terminal input: sudo gem Update--system). If successful there will be a hint of successfully installed Cocoapods.

2, Cocoapods use

Create the Podfile file in the project, the Terminal CD project directory file such as: Cd/users/user/desktop/demo/calayer. Create Podfile file via vim, terminal input: Vim podfile, enter, keyboard input I enter VIM insert mode, enter:

1

2

3

4

5

Platform:ios, ' 7.0 '

Pod ' mantle '

Pod ' Lbblurredimage '

Pod ' tsmessages '

Pod ' Reactivecocoa '

Then press ESC and enter the ":" Sign into the VIM command mode, then enter WQ after the colon (indicating write and exit)

3. In the terminal input pod install?

1

Pod Install

The initialization pod is also a network request download process, wait a period of time, if the input resource name is not a problem, then over a period of time will be in the terminal to initialize the successful prompt.

4, enter the project folder, you can see a suffix name is not. workspace file, double-click Open, Project code is written here.

Note: When adding a new third party, after modifying the Podfile file, you need to re-execute the pod install command.

Use of Cocoapods in iOS engineering

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.