1. Private library use
The advent of pods has greatly accelerated the speed of IOS development, powerful package management, and strong collaboration capabilities, which have greatly accelerated the efficiency of our development.
In addition to the open third-party library, we need our own private pod. For example, when developing a project, we can combine git to form a new development model.
In this form, each module can be stripped out to minimize the coupling rate between the modules. Everyone can pull commitat any time, other team members can upgrade their interface through pod update , so we can use a few simple commands, instead of the original SVN stupid operation.
2. How to set up a private library (based on Git)
First of all we need to understand two file uses.
2.1.1 Podspec
It is the description of your entire pod library, including author, version, license, address, etc.
2.1.2 Podfile
It is the collection address of the pod you need for your project. For example, my pod includes Fmdb,afn, and so on. The git private libraries we write in the future will also appear here.
Next we start making the journey to the Pod private library.
2.2.1. Generating Pods
1 |
Pod Spec Create Kkframework |
After that we will produce a Kkframewor.podspec file
2.2.2 Custom Podspec
1 |
Vim Kkframework.podspec |
This is in accordance with our settings, specifically can see http://www.coneboy.com/?p=1267
In particular, it is important to note that
S.source must be the git address of our own pod library.
2.2.3.podspec
1 |
Pod Spec Lint Kkframework.podspec |
2.2.4. Put the podspec where we can access it, like gist.
Gist of an instance
2.2.5. Modifying the podfile of a project
1 |
Pod ' kkframework ', :p odspec =>' Point to our gist address ' |
2.2.6. Updating the Podfile (if not installed)
Caveats: Git library access issues in 1.podfile
In general, HTTPS access will be problematic (annoying 502), so use the SSH protocol, if your own RSA secret key is wrong, need to regenerate,
Build method: First need to clear ~/.ssh below the previous legacy files, it is best to delete all files, especially known_hosts.
Build method
1 |
SSH-keygen- t RSA- C "[email protected]" |
Finally find your own public key in Isr.pub to put on the GIT server, and then ssh-t [email protected] Test
2.pod using file Correspondence relationship
The pod in the podfile is its own git library address, so it must be specifically specified, otherwise it will not work properly.
3.git Note
Podspec is based on a git tag to pull a version, so don't forget to push tag!
Reprint please indicate the source, all rights reserved Coneboy_k
Http://www.coneboy.com
Xi ' an iOS development, Cocoapod Private library, pod private
Writing Cocoapod Private libraries