iOS: add show tree node action

This commit is contained in:
王劲鹏
2021-07-14 19:54:34 +08:00
committed by osborn
parent 7fd81ce92c
commit d4477ac2a3
7 changed files with 257 additions and 0 deletions

View File

@@ -28,6 +28,7 @@
#import "QRScanViewController.h"
#import "DoricDebugDriver.h"
#import "DoricSnapshotView.h"
#import "DoricShowNodeTreeViewController.h"
@interface DoricContextCell : UITableViewCell
@property(nonatomic, strong) UILabel *tvId;
@@ -106,6 +107,22 @@ - (void)onClick {
}];
[alertController addAction:cancel];
[alertController addAction:viewSource];
UIAlertAction *showNodeTree = [UIAlertAction actionWithTitle:@"Show node tree" style:UIAlertActionStyleDefault handler:^(UIAlertAction *_) {
DoricShowNodeTreeViewController *doricShowNodeTreeViewController = [[DoricShowNodeTreeViewController alloc] init];
doricShowNodeTreeViewController.contextId = self.doricContext.contextId;
UIViewController *viewController = [UIApplication sharedApplication].delegate.window.rootViewController;
UINavigationController *navigationController;
if ([viewController isKindOfClass:[UINavigationController class]]) {
navigationController = (UINavigationController *) viewController;
} else {
navigationController = viewController.navigationController;
}
[navigationController pushViewController:doricShowNodeTreeViewController animated:NO];
}];
[alertController addAction:showNodeTree];
if (DoricDev.instance.isInDevMode) {
if ([self.doricContext.driver isKindOfClass:DoricDebugDriver.class]) {
UIAlertAction *stopDebugging = [UIAlertAction actionWithTitle:@"Stop debugging" style:UIAlertActionStyleDefault handler:^(UIAlertAction *_) {