HDB-Li/LLDebugTool

多次present之后 小圆点出不来了

datafu opened this issue · 0 comments

   UIViewController* vc = [[[UIApplication sharedApplication].delegate window] rootViewController];
    UIViewController* vc2 = vc.presentedViewController;

====》只获取到第一次present后的控制器
[vc2?:vc presentViewController:self.tabVC animated:YES completion:nil]; //如果多次prensent之后 控制器就不是第一次的了😯 导致 不能prensentviewcontroller

//是否需要 遍历获取最顶层的 vc
UIViewController *RootVC = [UIApplication sharedApplication].keyWindow.rootViewController;

UIViewController *topVC = RootVC;

while (topVC.presentedViewController) {
    
    topVC = topVC.presentedViewController;
    
}

return topVC;