1.安装好cocoapods,
2.注册gitte 或者github 账号
3.注册完账号好开始创建仓库:

4.创建完仓库后,将远程仓库克隆到本地:git clone https://XXXXXXXXXXXXXXX/YQPublicComponent.git
5.克隆完成后开始创建组件工程用终端创建:pod lib create 项目名称

6.创建组件工程后,将以下文件复制到克隆的仓库中:

7.将开发好的文件放到如下文件中:

8:复制完成以后pod install

9.修改podspec文件

10.修改完文件之后:将本地仓库推送到远程仓库:
终端:cd /项目地址
git add .
git commit -m "xxxxxxxxx"
git push -u origin master
11.推送到远程仓库后:打tag
git tag '1.0.0'
git push --tags
11.开始创建远程私有仓库spec,该仓库主要用于存放私有库中的.podspec 文件

12.创建完成后将仓库添加到本地:pod repo add (仓库名称) (仓库地址)
13.查看repo:pod repo 是否已经添加成功
14.添加成功后开始验证我们的私有库:
pod lib lint
pod lib lint --allow-warnings --verbose
15:远程验证:pod spec lint --allow-warnings
16.验证成功后:将私有库的.podspec 文件提交到远程存放podspec的仓库: pod repo push [Spec仓库名] [私有库索引文件名(.podspec)]
忽略警告
pod repo push [Spec仓库名] [私有库索引文件名(.podspec)] --verbose --allow-warnings
17.如果添加第三方库并包含静态包时需使用use-libraries
pod repo push [Spec仓库名] [私有库索引文件名(.podspec)] --verbose --use-libraries --allow-warnings
18.如果私有库中包含了,其他私有库:
pod repo push[Spec仓库名][私有库索引文件名(.podspec)]--sources='[Spec私有库地址],https://github.com/CocoaPods/Specs.git'--use-libraries--allow-warnings
19.上传完成后开始使用
远程使用:pod '私有库名称',:git=>'https://github.com/私有库地址'
本地使用: pod "私有库名称" :path => './私有库路径'