一、将文件上传到svn或者git,进到文件夹使用pod spec create YourFramework 命令创建podspec
二、按照如下格式修改,详细参数查看CocoaPods Guides - Podspec Syntax Reference
1)基础配置

2)可能涉及到有的库需要系统Framework的支持,需要在s.frameworks 指定
例如:

需要注意resolv这个库实际名称为libresolv.tbd,在传入时只写名字不写"lib"前缀也不写后缀。
3)有的库需要-ObjC,这里写

4)如果你的framework需要依赖其他公开库在s.dependency注明
例如:

添加后删除#。
三、修改podspec后,在终端用pod lib lint 命令验证podspec是否合法
验证通过后将podspec上传到git或者svn。
四、在其他项目中使用
在其他项目的PodFile中,加入私有仓库的下载地址:

五、pod install 完成
网友评论