When using hidesBottomBarWhenPushed, i want the tab bar to reappear when i push another view

前端 未结 6 1177
南方客
南方客 2020-12-06 11:09

I have a navigation controller. For one of the views i want to hide the bottom tab bar, so it gets the max possible screen real estate. To do this, i have:

-         


        
6条回答
  •  有刺的猬
    2020-12-06 11:42

    It's been a while since this question was asked, but none of these answers address using Storyboard segues. It turns out to be pretty easy:

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    
        if segue.identifier == "MyViewControllerIdentifier" {
    
            // Hide the tabbar during this segue
            hidesBottomBarWhenPushed = true
    
            // Restore the tabbar when it's popped in the future
            DispatchQueue.main.async { self.hidesBottomBarWhenPushed = false }
    
        }
    }
    

提交回复
热议问题