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
//
//  DHModuleManager.h
//  DHHive
//
//  Created by iblue on 2017/7/13.
//  Copyright © 2017年 jiangbin. All rights reserved.
//
 
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "DHModuleProtocol.h"
 
@interface DHModuleManager : NSObject
 
/**
 获取内部的模块
 */
@property (nonatomic, strong, readonly) NSArray<id<DHModuleProtocol>> *modules;
 
+ (instancetype)sharedInstance;
 
/**
 加载模块  一般在程序启动时候执行  且只执行一次
 
 @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