問題
ViewControllerA → ViewControllerB → ViewControllerC
と遷移する時に、
ViewControllerBでタブバーを非表示化したい。
ただし、
ナビゲーションバーの「戻る」ボタンで B から A に戻った時と
B から C に遷移した時はタブバーを再表示する。
解決方法
navigationViewControllerにBをpushする前に、
AのViewControllerのhidesBottomBarWhenPushedをtrueに設定し、
push後にhidesBottomBarWhenPushedをfalseに設定する。
AからBに遷移するコード
self.hidesBottomBarWhenPushed = true
self.navigationController.pushViewController(viewControllerB, animated: true)
self.hidesBottomBarWhenPushed = false