0

I try do it in willMove method but get bug when I break gesture(swipe to back VC)

override func willMove(toParent parent: UIViewController?) {
super.willMove(toParent: parent)

self.tabBarController?.tabBar.isHidden = true
}

2 Answers2

2

Use below method in ViewDidLoad() of ViewController(where you are going)

self.tabBarController?.tabBar.isHidden = true

and in ViewDidDisappear()

self.tabBarController?.tabBar.isHidden = false
Saurabh pandey
  • 260
  • 1
  • 11
  • Can I do it in current VC? Don't use both VC? – Aleksandr Maybach Sep 21 '18 at 06:56
  • You can do it in current VC where you are going(Push/Pop). its mean for a specific view controller tab bar will be hidden and when you are about to leave that controller form stack then tab bar will show. if any issue please let me know – Saurabh pandey Sep 21 '18 at 07:24
0

In your current view controller:

In viewDidDisappear:

self.tabBarController?.tabBar.isHidden = true

In ViewDidAppear:

self.tabBarController?.tabBar.isHidden = false
Ankit Jayaswal
  • 5,549
  • 3
  • 16
  • 36