iOS add View Node

This commit is contained in:
pengfei.zhou
2019-07-30 21:05:27 +08:00
parent 5d710b5b97
commit 20986340d7
17 changed files with 547 additions and 335 deletions

View File

@@ -97,6 +97,27 @@ - (DoricAsyncResult *)invokeContextEntity:(NSString *)contextId method:(NSString
});
return ret;
}
- (DoricAsyncResult *)invokeContextEntity:(NSString *)contextId method:(NSString *)method argumentsArray:(NSArray *)args {
DoricAsyncResult *ret = [[DoricAsyncResult alloc] init];
NSMutableArray *array = [[NSMutableArray alloc] init];
[array addObject:contextId];
[array addObject:method];
for (id arg in args){
[array addObject: arg];
}
__weak typeof(self) _self = self;
dispatch_async(self.jsExecutor.jsQueue, ^(){
__strong typeof(_self) self = _self;
if (!self) return;
@try {
JSValue *jsValue = [self.jsExecutor invokeDoricMethod:DORIC_CONTEXT_INVOKE argumentsArray:array];
[ret setupResult:jsValue];
} @catch (NSException *exception) {
[ret setupError:exception];
}
});
return ret;
}
- (DoricAsyncResult *)createContext:(NSString *)contextId script:(NSString *)script source:(NSString *)source {
DoricAsyncResult *ret = [[DoricAsyncResult alloc] init];