Skip to content

Commit

Permalink
按照枚举模式优化 DoraemonManager 的默认模块数据新增和删除!
Browse files Browse the repository at this point in the history
  • Loading branch information
boai committed Feb 13, 2019
1 parent c0cba63 commit f7439de
Show file tree
Hide file tree
Showing 5 changed files with 281 additions and 29 deletions.
60 changes: 60 additions & 0 deletions iOS/DoraemonKit/Src/Core/Manager/DoraemonManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,64 @@

typedef void (^DoraemonH5DoorBlock)(NSString *);

typedef NS_ENUM(NSUInteger, DoraemonManagerPluginType) {
#pragma mark - 常用工具
// App信息
DoraemonManagerPluginType_DoraemonAppInfoPlugin,
// 沙盒浏览
DoraemonManagerPluginType_DoraemonSandboxPlugin,
// MockGPS
DoraemonManagerPluginType_DoraemonGPSPlugin,
// H5任意门
DoraemonManagerPluginType_DoraemonH5Plugin,
// Crash查看
DoraemonManagerPluginType_DoraemonCrashPlugin,
// 子线程UI
DoraemonManagerPluginType_DoraemonSubThreadUICheckPlugin,
// 清除本地数据
DoraemonManagerPluginType_DoraemonDeleteLocalDataPlugin,
// NSLog
DoraemonManagerPluginType_DoraemonNSLogPlugin,
// 日志显示
DoraemonManagerPluginType_DoraemonCocoaLumberjackPlugin,

#pragma mark - 性能检测
// 帧率监控
DoraemonManagerPluginType_DoraemonFPSPlugin,
// CPU监控
DoraemonManagerPluginType_DoraemonCPUPlugin,
// 内存监控
DoraemonManagerPluginType_DoraemonMemoryPlugin,
// 流量监控
DoraemonManagerPluginType_DoraemonNetFlowPlugin,
// 卡顿检测
DoraemonManagerPluginType_DoraemonANRPlugin,
// 自定义 性能数据保存到本地
DoraemonManagerPluginType_DoraemonAllTestPlugin,
// Load耗时
DoraemonManagerPluginType_DoraemonMethodUseTimePlugin,

#pragma mark - 视觉工具
// 颜色吸管
DoraemonManagerPluginType_DoraemonColorPickPlugin,
// 组件检查
DoraemonManagerPluginType_DoraemonViewCheckPlugin,
// 对齐标尺
DoraemonManagerPluginType_DoraemonViewAlignPlugin,
// 元素边框线
DoraemonManagerPluginType_DoraemonViewMetricsPlugin
};

@interface DoraemonManagerPluginTypeModel : NSObject

@property(nonatomic, copy) NSString *title;
@property(nonatomic, copy) NSString *desc;
@property(nonatomic, copy) NSString *icon;
@property(nonatomic, copy) NSString *pluginName;
@property(nonatomic, copy) NSString *atModule;

@end

@interface DoraemonManager : NSObject

+ (DoraemonManager *)shareInstance;
Expand All @@ -23,6 +81,8 @@ typedef void (^DoraemonH5DoorBlock)(NSString *);

- (void)addPluginWithTitle:(NSString *)title icon:(NSString *)iconName desc:(NSString *)desc pluginName:(NSString *)entryName atModule:(NSString *)moduleName;

- (void)removePluginWithPluginType:(DoraemonManagerPluginType)pluginType;
// 推荐使用 removePluginWithPluginType 方法
- (void)removePluginWithPluginName:(NSString *)pluginName atModule:(NSString *)moduleName;

- (void)addStartPlugin:(NSString *)pluginName;
Expand Down
Loading

0 comments on commit f7439de

Please sign in to comment.