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不通過