feat:HeadNodes use Dictionary instead of set

This commit is contained in:
pengfei.zhou
2019-11-29 09:43:14 +08:00
parent 35d377f9b9
commit c0eae0f8a2
3 changed files with 6 additions and 11 deletions

View File

@@ -33,7 +33,7 @@ - (void)show:(NSDictionary *)params withPromise:(DoricPromise *)promise {
[it initWithSuperNode:nil];
it.view.layoutConfig = [DoricLayoutConfig new];
[self.fullScreenView addSubview:it.view];
[self.doricContext.headNodes addObject:it];
self.doricContext.headNodes[viewId] = it;
}];
}
[viewNode blend:params[@"props"]];
@@ -55,7 +55,7 @@ - (void)dismiss:(NSDictionary *)params withPromise:(DoricPromise *)promise {
}
- (void)dismissViewNode:(DoricViewNode *)node {
[self.doricContext.headNodes removeObject:node];
[self.doricContext.headNodes removeObjectForKey:node.viewId];
[node.view removeFromSuperview];
if (self.doricContext.headNodes.count == 0) {
self.fullScreenView.hidden = YES;
@@ -63,7 +63,7 @@ - (void)dismissViewNode:(DoricViewNode *)node {
}
- (void)dismissPopover {
for (DoricViewNode *node in self.doricContext.headNodes) {
for (DoricViewNode *node in self.doricContext.headNodes.allValues) {
[self dismissViewNode:node];
}
}