How to hide a navigation bar from first ViewController in Swift?
问题 How can I hide a navigation bar from first ViewController or a particular ViewController in swift? I used the following code in viewDidLoad() : override func viewDidLoad() { super.viewDidLoad() self.navigationController?.isNavigationBarHidden = true } and also on viewWillAppear : override func viewWillAppear(animated: Bool) { self.navigationController?.isNavigationBarHidden = true } Both methods hide the navigation controller from all ViewControllers. 回答1: If you know that all other views