feat:add debug option stop debugging

This commit is contained in:
pengfei.zhou
2021-03-02 11:52:03 +08:00
committed by osborn
parent 4e5b1c94bf
commit de4188b74e
2 changed files with 28 additions and 8 deletions

View File

@@ -105,6 +105,13 @@ - (void)onClick {
}];
[alertController addAction:cancel];
[alertController addAction:viewSource];
if ([self.doricContext.driver isKindOfClass:DoricDebugDriver.class]) {
UIAlertAction *stopDebugging = [UIAlertAction actionWithTitle:@"Stop debugging" style:UIAlertActionStyleDefault handler:^(UIAlertAction *_) {
[DoricDev.instance stopDebugging:YES];
}];
[alertController addAction:stopDebugging];
}
[self.vc presentViewController:alertController animated:true completion:nil];
}
@end
@@ -311,11 +318,15 @@ - (UIImage *)decodeImage:(BOOL)on {
return [UIImage imageWithData:imageData];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
- (NSInteger)tableView:(UITableView *)tableView
numberOfRowsInSection:
(NSInteger)section {
return [DoricContextManager.instance aliveContexts].count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:
(NSIndexPath *)indexPath {
DoricContextCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
if (cell == nil) {
cell = [[DoricContextCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
@@ -351,7 +362,9 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
- (CGFloat) tableView:(UITableView *)tableView
heightForRowAtIndexPath:
(NSIndexPath *)indexPath {
return 60.f;
}
@@ -375,7 +388,9 @@ - (void)onFailure:(NSError *)error {
[self.listView reloadData];
}
- (void)onReload:(DoricContext *)context script:(NSString *)script {
- (void)onReload:(DoricContext *)context
script:
(NSString *)script {
[self.listView reloadData];
}