iOS14 pop时tabbar不显示的问题

项目在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];

}

加油

你可能感兴趣的:(iOS14 pop时tabbar不显示的问题)