iOS Platform Software development tools (i)-new projects integrate third-party frameworks using the Cocoapods tool

Source: Internet
Author: User

Cocoapods is a collection of thousands of third-party open Source Library development tools, can greatly improve the team project development efficiency, reduce time costs.

So take a look at cocoapods. The use of this tool is reflected in the project.

We immediately use the asihttprequest third-party open source framework to explain how to use the Cocoapods tool in our projects to quickly integrate third-party open source frameworks .

First, create an empty application engineering emptysampleunder the iOS platform.

Then, enter the new project directory in the terminal,

Results.

Under the new project root directory, create a new Podfile file with the VI command . Note that you do not have to add the file suffix name )

VI podfile

Then we'll edit the content in the podfile file as

' 7.0 '  'asihttprequest'~> 1.8.2'

After saving the file, we can see that a podfile file is already in the root of the newly-created Emptysample project.

Next, use the pod Update command in the terminal to update our project, and when the following appears, the project is updated according to the Podfile file. ( note that because the third-party open source framework

need a network download, so there will be a brief stagnation in the middle )

Update all podsanalyzing dependenciesdownloading dependenciesinstalling asihttprequest (1.8. 2 ) Installing reachability (3.1. 1 ) generating Pods projectintegrating client project[!] From "On" Use ' emptysample.xcworkspace '.

So now we need to pay attention to two.

    • The pod Update command can only be used when the third-party tool has been installed in our Mac OS environment cocoapods;
    • pod Update The command can only be used if the Podfile file is already contained in the terminal's current directory;
    • pod Update the function of the command is to update the current project directory and the engineering files in the project catalog according to the contents of the Podfile file . (***.xcodeproj)

When the project is successfully updated, we can open the project again without opening the ***.xcodeproj file, but open the ***.xcworkspace.

Next, let's take a look at how to configure the Cocoapods tool in your environment, as well as engineering updates in projects that already use 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.