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

前端 未结 12 1599
悲哀的现实
悲哀的现实 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:13

    In IOS 8 do it like

    navigationController?.hidesBarsOnTap = true
    

    but only when it's part of a UINavigationController

    make it false when you want it back

提交回复
热议问题