项目在iOS14上运行出现了一个问题,A->B->C,接着在C界面pop回A,tabbar居然消失了。
解决方案:
- (NSArray<__kindof UIViewController *> *)popToRootViewControllerAnimated:(BOOL)animated{
if (self.viewControllers.count > 0 ) {
UIViewController *popController = self.viewControllers.lastObject;
if ([popController isKindOfClass:[CustomCViewController class]]) {
popController.hidesBottomBarWhenPushed = NO;
}
}
return [super popToRootViewControllerAnimated:animated];
}
加油