How to hide a navigation bar from first ViewController in Swift?

前端 未结 12 1585
悲哀的现实
悲哀的现实 2020-11-30 17:03

How can I hide a navigation bar from first ViewController or a particular ViewController in swift?

I used the following code in viewDidLoad():

12条回答
  •  爱一瞬间的悲伤
    2020-11-30 17:25

    Ways to hide Navigation Bar in Swift:

    self.navigationController?.setNavigationBarHidden(true, animated: true)
    self.navigationController?.navigationBar.isHidden = true
    self.navigationController?.isNavigationBarHidden = true
    

提交回复
热议问题