组件化过程中问题

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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。