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.业务组件采用target-action通信时,业务组件提供接口,Mediator分类如何放置?
5.spec参考: https://guides.cocoapods.org/syntax/podspec.html
6.plist资源问题: s.resources = "XMGFMMine/Assets/*.plist"
7.组件依赖其它组件的协议时,未导入仅引用协议文件,导致pod lib lint不通过
网友评论