1、在GitHub上创建自己的仓库
在terminal中执行下面的命令 pod repo add topsiOSSpecs https://github.com/..../topsiOSSpecs.git
2、创建私有库
pod spec create topsiOSPro
创建成功之后项目会自动打开,修改如下内容
将原来的swift文件删除,替换自己的文件
public class HelloWorld:NSObject {
override init() {
super.init()
}
public class func hello(){
print("this is in hello !")
}
public static let words = "mine is words !"
}
3、在GitHub上创建项目
4、将本地项目提交到GitHub
git add .
git commit -m "第一次提交"
git push orign master
git tag '0.1.0'
git push --tags
执行 pod spec lint --allow-warnings
命令,通过后执行下列命令
pod repo push topsiOSSpecs topsiOSPro.podspec --allow-warnings
5、后续添加新功能,首先提交到GitHub,然后执行pod spec lint --allow-warnings
命令,最后执行pod repo push ...
命令
6、使用,创建Podfile
target 'swiftPro' do
dynamic frameworks
source 'https://github.com/..../topsiOSSpecs'
platform :ios, '10.0'
use_frameworks!
pod 'topsiOSPro'
target 'swiftProTests' do
inherit! :search_paths
# Pods for testing
end
target 'swiftProUITests' do
inherit! :search_paths
# Pods for testing
end
end
常见错误