JLChen
2021-05-18 a869383e163a18cdedcf587383c1eca043129754
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//
//  DHHive.h
//  DHHive
//
//  Created by iblue on 2017/7/12.
//  Copyright © 2017年 jiangbin. All rights reserved.
//
 
#import "DHServiceProtocol.h"
#import "DHModuleProtocol.h"
#import "DHRouter.h"
#import <UIKit/UIKit.h>
 
@interface DHModule : NSObject
 
+ (instancetype)sharedInstance;
 
/**
 绑定服务协议与实现类
 
 @param service 服务协议
 @param implClass 实现类
 */
+ (void)registerService:(Protocol *)service implClass:(Class)implClass;
 
/**
 取得服务协议对应的实现类
 
 @param service 服务协议
 @return 实现类
 */
+ (id)implForService:(Protocol *)service;
 
/**
 加载模块  一般在程序启动时候执行  且只执行一次
 
 @param moduleArray 加载模块的名称数组  模块类必须继承IAppModule协议
 */
+ (void)loadModuleByNameArray:(NSArray <NSString *> *)moduleArray;
 
/**
 向所有模块传递自定义事件
 
 @param event 事件名称
 @param userInfo 传递的参数
 */
+ (void)deliveryCustomEvent:(NSString *)event userInfo:(NSDictionary *)userInfo;
 
/**
 向指定模块传递自定义事件
 
 @param moduleArray 可以为空,为空时,表示向所有注册的模块传递自定义事件;
 @param event 自定义事件名称
 @param userInfo 传递的参数
 */
+ (void)deliveryModule:(NSArray <NSString *> *)moduleArray customEvent:(NSString *)event userInfo:(NSDictionary *)userInfo;
    
@end