feat: add DoricDevAssetsLoader in dev mode
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#import "DoricDevMonitor.h"
|
||||
#import "DoricDevPerformanceAnchorHook.h"
|
||||
#import "DoricDevkitPlugin.h"
|
||||
#import "DoricDevAssetsLoader.h"
|
||||
|
||||
@interface DoricContextDebuggable : NSObject
|
||||
@property(nonatomic, weak) DoricContext *doricContext;
|
||||
@@ -83,6 +84,7 @@ - (instancetype)init {
|
||||
[DoricSingleton.instance.nativeDriver.registry registerMonitor:[DoricDevMonitor new]];
|
||||
DoricSingleton.instance.nativeDriver.registry.globalPerformanceAnchorHook = [DoricDevPerformanceAnchorHook new];
|
||||
[DoricSingleton.instance.nativeDriver.registry registerNativePlugin:DoricDevkitPlugin.class withName:@"devkit"];
|
||||
[DoricSingleton.instance.nativeDriver.registry.loaderManager registerLoader:[DoricDevAssetsLoader new]];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
9
doric-iOS/Devkit/Classes/DoricDevAssetsLoader.h
Normal file
9
doric-iOS/Devkit/Classes/DoricDevAssetsLoader.h
Normal file
@@ -0,0 +1,9 @@
|
||||
//
|
||||
// Created by pengfei.zhou on 2021/12/7.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <DoricCore/DoricAssetsResourceLoader.h>
|
||||
|
||||
@interface DoricDevAssetsLoader : DoricAssetsResourceLoader
|
||||
@end
|
16
doric-iOS/Devkit/Classes/DoricDevAssetsLoader.m
Normal file
16
doric-iOS/Devkit/Classes/DoricDevAssetsLoader.m
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// Created by pengfei.zhou on 2021/12/7.
|
||||
//
|
||||
|
||||
#import "DoricDevAssetsLoader.h"
|
||||
#import "DoricDev.h"
|
||||
|
||||
@implementation DoricDevAssetsLoader
|
||||
|
||||
- (__kindof DoricResource *)load:(NSString *)identifier withContext:(DoricContext *)context {
|
||||
if (DoricDev.instance.isInDevMode) {
|
||||
|
||||
}
|
||||
return [super load:identifier withContext:context];
|
||||
}
|
||||
@end
|
Reference in New Issue
Block a user