模块
跨模块调用
熊小憨
这个作者很懒,什么都没留下…
展开
-
模块化
跨模块跨模块调用的方案有:MGJRouterCTMediatorBeeHive代理原创 2021-04-19 15:44:17 · 46 阅读 · 0 评论 -
MGJRouter使用指南
1. 安装MGJRouterpod ‘MGJRouter’https://github.com/meili/MGJRouter2. 注册MGJRouter[MGJRouter registerURLPattern:URLPattern toHandler:^(NSDictionary *routerParameters) { NSString *url = [routerParameters valueForKey:MGJRouterParameterURL]; void(^co原创 2021-04-13 10:56:14 · 479 阅读 · 0 评论 -
MGJRouter原理解析
1. 属性MGJRouter中有个重要的属性:@property (nonatomic) NSMutableDictionary *routes;该属性保存了所有已注册的 URL,其结构类似于:@{ @"project": @{ @"query": @{ @":keywork": @{ @"_": <__NSGlobalBlock__: 0x104ebc100> }原创 2021-04-15 18:14:18 · 649 阅读 · 0 评论 -
CTMediator使用指南
1. 安装CTMediatorpod ‘CTMediator’https://github.com/casatwy/CTMediator2. 注册CTMediator创建Target对象@interface Target_Object : NSObject@end@implementation Target_Object@end实现Action方法- (id)Action_Method:(NSDictionary *)params {}或- (void)Ac原创 2021-04-16 14:42:26 · 303 阅读 · 0 评论 -
CTMediator原理解析
CTMediator调用以下方法:- (id _Nullable )performTarget:(NSString * _Nullable)targetName action:(NSString * _Nullable)actionName params:(NSDictionary * _Nullable)params shouldCacheTarget:(BOOL)shouldCacheTarget;会执行以下步骤:通过targetName拼接类名,获取对应的类,创建或从缓存中查找对象;通过a原创 2021-04-16 15:49:59 · 175 阅读 · 0 评论 -
BeeHive使用指南
1. 前言BeeHive使用的核心有两个:Module和Service。Module用于响应ApplicationDelegate的各种事件。Service用于一个模块使用另一个模块的功能。2. Module创建创建一个基于BHModuleProtocol的对象即可。@interface Module() <BHModuleProtocol>@end@implementation Module@end3. Module注册使用宏BeeHiveMod原创 2021-04-16 18:00:47 · 1658 阅读 · 0 评论 -
BeeHive原理解析
1. BHAppDelegate替代AppDelegate的类,响应UIApplicationDelegate的方法。该类有以下作用:调用BHModuleManager的- (void)triggerEvent:(NSInteger)eventType;方法,用于向各个模块转发应用事件。更新BeeHive的context数据。PS该类代码是非常正宗的AppDelegate写法,具有非常大的参考意义。2. Module注册不管哪一种Module注册方法,最终都离不开BHModuleMana原创 2021-04-19 17:23:15 · 523 阅读 · 0 评论