Pod 制作私有庫參考
https://www.jianshu.com/p/f903ecf8e882
Pod私有庫的升級
改代碼部分,到Example文件夾執行pod install ,修改XXX.specs文件(版本號,依賴什么的)
提交代碼修改,打tag,注意tag 一定要和XXX.specs文件中的版本號一致
cd到 pod lib create XXX 的那個文件夾,執行pod repo push WLF_iOS_Specs WLFComponentTableView.podspec --verbose --allow-warnings
作用是將索引推到遠程索引庫
注意事項:
1. 當制作的Pod私有庫引用了其他已存在的庫時,將#import "**.h" 第三方庫寫在 .m文件中,而不是放在.h文件中。在.h文件中@class xxx 即可。
不然會報錯:
include of non-modular header inside framework module
2. 千萬不要因為pod 慢刪掉pod repo 中的master , 不然每次pod install 時都得下載master 30多MB , 而且很卡很慢。
3. 在構建WLFH5Template 組件時,因為該組件引用了
s.dependency 'SDWebImage' s.dependency 'FLAnimatedImage' s.dependency 'HZPhotoBrowser_Refresh' s.dependency 'JMGTemplateEngine_Refresh'
一定要注意順序!!!
然后就是驗證,推送遠程索引時加上pod 的source:
pod lib lint --sources='http://code.shftz.cn:84/liuwei/WLF_iOS_Specs.git,http://github.com/CocoaPods/Specs.git' --use-libraries --allow-warnings pod repo push WLF_iOS_Specs WLFH5Template.podspec --sources='http://code.shftz.cn:84/liuwei/WLF_iOS_Specs.git,http://github.com/CocoaPods/Specs.git' --verbose --allow-warnings
不然一直驗證不通過
雖然制作完成了,但是當進一個項目, pod search WLFH5Template 時又會報警告,無法搜索到這個庫,不知道為什么///???
4. 用pod lib create 組件名時 ,新建本地代碼關聯到遠程,git push 時會出現各種問題。解決辦法是通過IDEA圖形化工具打開工程,然后git pull ,按照錯誤一步一步來解決。
5. 安裝Pod時有這種黃色警告,不過這些都不影響運行
[!] 'HZPhotoBrowser_Refresh' uses the unencrypted 'http' protocol to transfer the Pod. Please be sure you're in a safe network with only trusted hosts. Otherwise, please reach out to the library author to notify them of this security issue.
6. 更新指定引用庫
pod update 要更新庫的名字
7.
RTComponentTableView 使用記錄
/// 配置組件內部UI
//- (UITableViewCell *)cellForTableView:(UITableView *)tableView atIndexPath:(NSIndexPath *)indexPath
//{
//
//}
/// 頭部高度
- (CGFloat)heightForComponentHeader
{
return 0.01;
}
/// 尾部高度
-(CGFloat)heightForComponentFooter
{
return 0.01;
}
/// 組件高度
- (CGFloat)heightForComponentItemAtIndex:(NSUInteger)index
{
return 180;
}
更具自己的需要修改了部分原框架代碼
http://code.shftz.cn:84/WLF_iOS_Components/RTComponentTableView.git