[iOS development] about the use of cocoapods

Source: Internet
Author: User

Use of Cocoapods

About Cocoapods, I believe that the development of iOS should be more familiar with. Cocoapods is an easy-to-use management tool for managing third-party libraries. The thing about Cocoapods no longer said, and then came to the chase.

My software version is as follows:

Xcode version is 7.3.1

Cocoapods version is 1.0

Manage with a terminal

The command to query the library is the same as before

$ pod Search name of the library to query

Only after the query is completed cannot be entered directly, you can press the Q key to exit the search page. Note, however, that the search results are gone after exiting, so find a place to save the pod commands you want to use.
Then, about the section created by Podfile. The official website now has an intelligently created command, and the usage is not much worse than the previous one. It is also necessary to switch the CD to the project directory first, and then enter the following command:

$ pod Init

You can see the familiar podfile files appearing in the project folder.
Then open the inside style as follows:

Platform:ios, ' 8.0 ' use_frameworks!target ' project name ' do  pod ' afnetworking ', ' ~> 2.6 '  pod ' orstackview ', ' ~> 3.0 '  pod ' Swiftyjson ', ' ~> 2.3 ' end

It's an official example of stealing some slack here.

Then you can start installing the ~ command unchanged:

$ pod Install

After the installation is complete, you can use the following command to open the project:

Open your project name. Xcworkspace

Attention:使用这个命令打开前必须要关闭.xcodeproj工程文件

Third-party libraries can then be used normally.

[iOS development] about the use of cocoapods

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.