
1、Git
去到github.com创建一个名称为name的项目
2、安装CocoaPods
sudo gem install cocoapods
3、创建Pod
pod lib create name
What is your email?
What platform do you want to use?? [ iOS / macOS ]
What language do you want to use?? [ Swift / ObjC ]
Would you like to include a demo application with your library? [ Yes / No ]
Which testing frameworks will you use? [ Specta / Kiwi / None ]
Would you like to do view based testing? [ Yes / No ]
What is your class prefix?
4、Podspec
修改工程目录下的JXCityPicker.podspec文件中的summary后的内容,不然之后会提示
- WARN | summary: The summary is not meaningful.
5、添加代码
工程文件Podspec Metadata下新建自己的代码文件
存放于name文件夹下的classes文件夹下
6、提交Pod
先打一个tag默认是0.1.0需要和配置中的一致
git tag 0.1.0
git push origin 0.1.0
先验证一下
pod spec lint name
第一次先注册一下
pod trunk register email 'JXCityPicker' --description='city picker'
推到CocoaPods仓库
pod trunk push name.podspec