Demo add devkit button

This commit is contained in:
pengfei.zhou
2021-07-14 11:51:45 +08:00
committed by osborn
parent 47022fe715
commit 0dfe0d73be
5 changed files with 67 additions and 3 deletions

View File

@@ -68,6 +68,10 @@ - (BOOL)isSimulator {
return TARGET_OS_SIMULATOR == 1;
}
- (void)onOpenDevkit {
[[DoricDev instance] openDevMode];
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row == 0) {
[[DoricDev instance] openDevMode:self];
@@ -79,6 +83,8 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
alias:self.demoFilePaths[(NSUInteger) indexPath.row]
extra:nil
];
UIBarButtonItem *rightBarItem = [[UIBarButtonItem alloc] initWithTitle:@"Devkit" style:UIBarButtonItemStylePlain target:self action:@selector(onOpenDevkit)];
doricViewController.navigationItem.rightBarButtonItem = rightBarItem;
[self.navigationController pushViewController:doricViewController animated:NO];
}