Notion: https://www.notion.so/iOS-d0787034de364495b9e8ab63eaa450ce
组件化是指解耦复杂系统时将多个功能模块拆分、重组的过程,有多种属性、状态反映其内部特性。
前端界一马平川,大家再也不用一行行代码去写了 ( -> html )
iOS 私有库实现
创建私有空间
1. 到你喜欢的 git 平台,创建一个私有仓库(名字随意)
2. 在 pod 里添加你的私有空间
pod repo add XXXSpace https://git.....
向私有空间里扔进你的私有库
- 创建私有库模板
pod lib create XXX
创建的时候会问很多问题
创建完模板,就可以创建一个 git 仓库,然后把模板里的文件拷进 git 创建的仓库里
- 把私有库上传到自己的私有空间
- 检测
pod lib lint --allow-warnings
- 提交代码到 git
- 注意你私有库的里版本,要和 git 的上的版本对应。确认好后就可以进行下一步
- 上传到私有库
`pod repo push XXXSpace *.podspec --allow-warnings`
`--use-libraries (引入其他第三库的时候,需要加这句话)
pod repo push XXXSpace *.podspec --allow-warnings --use-libraries`
XXXSpace 指的是 `~/.cocoapods/repos` 文件夹下,你私有空间的名字
-
podspec 配置
使用你的私有空间
# 如果自己的空间中用到了 CocoaPods 里的资源, 那饮用自己资源的时候, 同时也要引用CocoaPods的资源
# 在 podfile 文件中
source 'https://github.com/CocoaPods/Specs.git'
source 'https://.....' # 你自己的私有空间地址
# 然后你就可以 pod install
## --sources=='https://github.com/CocoaPods/Specs.git,https://......' 会有用到的时候
上传新版本 要注意什么
修改 .podspec 版本
提交代码到git 并上传 tag
推送代码到自己的私有库
[http://blog.csdn.net/stubbornness1219/article/details/50968000](http://blog.csdn.net/stubbornness1219/article/details/50968000)
更新本地私有空间
来自:http://blog.csdn.net/h1101723183/article/details/53907461
更新私有仓库:
pod repo update [仓库名称]
有可能有缓存,需要先clean缓存后再pod install或pod update
pod cache clean PodName
添加公司私有仓库:
pod repo add oschina-qx2016-summersoft_specs git@git.oschina.net:qx2016/SummerSoft_Specs.git
网友评论