美文网首页
popToRootViewController 切换到tabBa

popToRootViewController 切换到tabBa

作者: 喵喵粉 | 来源:发表于2020-03-06 10:40 被阅读0次

popToRootViewController 切换到tabBarController页面出现了tabBar不显示的问题,将selectedIndex = index这句放到前面。

///回到tab的第N个页面
extension UIViewController {
    func extPopToTabBarIndex(_ index: Int) {
        self.tabBarController?.selectedIndex = index
        navigationController?.popToRootViewController(animated: true)
    }
}

相关文章

网友评论

      本文标题:popToRootViewController 切换到tabBa

      本文链接:https://www.haomeiwen.com/subject/jiuvrhtx.html