Search code examples
iosswiftuitableviewios-autolayoutuitabcontroller

How do I stretch the view when tab is hidden


I'm using the auto layout via the storyboard.

override func viewWillAppear(animated: Bool) {

    //hide bottom bar
    self.tabBarController?.tabBar.hidden = true


}

// postload func
override func viewWillDisappear(animated: Bool) {
    self.tabBarController?.tabBar.hidden = false

}

enter image description here

As you can see black is tabczontroller's height..How do I stretch the view to screen's bottom?

enter image description here

enter image description here

enter image description here


Solution

  • You just layout to bottom layout guide which contains the tab bar.