1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Swift】遷移先のTabBarControllerを非表示にする

Posted at

どういうことか

遷移先ページの下のタブバーを非表示にしたい。

NextViewController.swift
self.tabBarController?.tabBar.isHidden = true

遷移先の viewDidLoad() にこれを書いても非表示にはなるが、なんらかの処理で遷移元に戻っても消えたままになってしまう。

遷移する処理に追加する

ViewController.swift
let storyboard = UIStoryboard(name: "NextViewController", bundle: nil)
let vc = storyboard.instantiateViewController(identifier: "NextViewController")

// コレ
vc.hidesBottomBarWhenPushed = true

self.navigationController?.pushViewController(vc, animated: true)

おわり(´・ω・`)

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?