0

I've encountered an issue that I cannot figure out for the life of me. The issue is only happening on the iPhone X. I've added a little video since its difficult to explain exactly whats happening.

I've also added a screenshot of my storyboard so you can see the flow.

Pretty much were experiencing a freeze when the tab bar is being hidden. It only happens when we visit the category VC (which is presented modally using a segue, it is also embedded in a navigation controller.)

** I'm still new to iOS development so if I'm doing anything terribly wrong feel free to share :)

Video: https://youtu.be/HC14zFxh-HM

Code that sends to reader:

@IBAction func sendToReader(_ sender: Any) {
    let myVC = storyboard?.instantiateViewController(withIdentifier: "ReaderRootVC") as! ReaderRootVC
    myVC.book = self.book
    myVC.hidesBottomBarWhenPushed = true
    navigationController?.pushViewController(myVC, animated: true)
}

Code that closes Category VC:

@IBAction func navigationCancelBtnPressed(_ sender: Any) {
    self.navigationController?.dismiss(animated: false, completion: nil)
}

Storyboard: enter image description here

dranieri
  • 199
  • 1
  • 7
  • you want to hide the UITabBar, when you push to another VC. Is that correct? – Alwin Mar 15 '18 at 16:07
  • Correct, and it seems to be working except when I open the Category VC first. Check the you tube video and you'll see. – dranieri Mar 15 '18 at 16:28

1 Answers1

1

In your ReaderRootVC,

override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        // Hide the Tab Bar
        self.tabBarController?.tabBar.isHidden = true
    }

    override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(animated)

        // Show the Tab Bar
        self.tabBarController?.tabBar.isHidden = false
    }
Alwin
  • 1,476
  • 3
  • 19
  • 35