IOS: How to manage your SDK with Cocoapods

Source: Internet
Author: User

Original Link:http://www.jianshu.com/p/7dd9bfe8ee69

Conditions:

you need to publish the project to Cocoapods on the terminal in order to manage it with cocoapods.

Steps:

First of all, you have to have a pod account in the terminal to enter the pod can see the command help on the pod, input pod trunk me can view their account information, if not, first register one. Enter the Pod trunk register and follow the prompts to register one.

Then, after you have an account:

CD to the project directory, create a. podspec file with the project name for example:
CD Demo---> Pod spec create Demo
This will cause such a file to appear in the project

  Then vi demo.podspec into the file to configure

   A summary of the project needs to be written to the S.summary
Then s.description can write a description of the project, or it can be commented out directly with #.
S.homepage wrote the URL of the project that was previously created on GitHub, such as: Https://github.com/xiaowu2016/Demo
S.license I chose the following one, and the above comment off, the file "" File_license "to the file" = "LICENSE".
S.source write the address of the project, such as: Https://github.com/xiaowu2016/Demo.git
Other configuration according to their actual needs, if the project has to rely on other third-party libraries should also be written. If you don't understand, you can go to GitHub to see someone else's. podspec file control to configure.

For example, the following mapping settings:


After the configuration is complete, save and exit, then enter on the terminal

git add ' demo.podspec ' (can also be directly lost git add )

  Then git commit-m ' Add demo.podspec ' to git

Then sync to the remote end with Git push

Create a license file again

VI LICENSE directly to the Internet to find a copy, according to the needs of their own modifications can be used.

Save and exit

git add ' LICENSE ' (or git add)

Git commit-m ' Add LICENSE '

git push

Then you need to create a project tag
git tag ' 0.0.1 '
git add *
Git commit-m ' add tag '
Git push Origin 0.0.1

After you've lost these commands, you can see the tag you created in GitHub's project.

again input pod spec lint to detect if there is an error or warning, rectify any mistakes, every time the local project has been changed and uploaded to GitHub after the need to change the tag or you will not find the changes, changing the tag You will then need to change the tag of S.version and S.source in the. podspec file to the same value.

If there is no error, you can publish the input pod trunk push, so that after the project needs you to encapsulate the class library can be added directly in the Podfile for example: Pod search ' Demo ' then pod Install can help you import, very convenient

IOS: How to manage your SDK with 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.