組件化過程中問題

1.組件子模塊對公共子模塊有依賴?

s.subspec 'AlertVC' do |alert|

alert.source_files = 'ZJFunc/Classes/AlertVC/**/*'.? ? #子模塊源

alert.dependency 'TYAlertController', '1.2.0' ? #子模塊對第三方庫依賴

alert.dependency 'ZJFunc/Public' ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??

end

2.組件中獲取Bundle及圖片(組件為.framework)

+ (UIImage*)imageNamed:(NSString*)imageName targetClass:(Class)targetClass {

? ? NSBundle*bundle = [NSBundle bundleForClass:targetClass];

? ? if(bundle && imageName && ![imageName isEqualToString:@""]) {

? ? ? ? NSInteger scale = [[UIScreen mainScreen] scale];

? ? ? ? NSString *bundleName = bundle.infoDictionary[@"CFBundleName"];

? ? ? ? NSString *directory = [bundleName ?stringByAppendingPathExtension:@"bundle"];

? ? ? ? NSString*fullName = [NSString stringWithFormat:@"%@@%zdx", imageName, scale];

? ? ? ? NSString *imagePath = [bundle pathForResource:fullName ofType:@"png" inDirectory:directory];

? ? ? ? return [UIImage imageWithContentsOfFile:imagePath];

? ? }

? ? return nil;

}

3.framework與.a如何集成到pod庫中??

參考: https://blog.csdn.net/w_shuiping/article/details/80606277

4.業(yè)務(wù)組件采用target-action通信時(shí),業(yè)務(wù)組件提供接口,Mediator分類如何放置?

5.spec參考:?https://guides.cocoapods.org/syntax/podspec.html

6.plist資源問題:?s.resources = "XMGFMMine/Assets/*.plist"

7.組件依賴其它組件的協(xié)議時(shí),未導(dǎo)入僅引用協(xié)議文件,導(dǎo)致pod lib lint不通過

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容