title: Navigation bar not showing iOS swift
body: <p>I am having multiple view controller in my application. I want to hide <code>navigationbar</code> in my first view controller. So I use the following code to hide the navigation bar</p>
  <pre><code>navigationController?.setNavigationBarHidden(navigationController?.navigationBarHidden == false, animated: true);
  </code></pre>
  <p>Now I want to add navigation bar in some other viewController but, my navigation bar not visible in that viewcontroller. Why it is happening?</p>
  <p>My storyboard showing the navigation bar but once I try to run my application it is gone.</p>
  <p>If I hide navigation bar from one view controller then we can't use navigation controller, Is it so? I hope I am wrong. Then what are the reasons for navigation bar not shown?</p>
  <p><strong>EDIT:</strong></p>
  <p>Also I want my view controller in portrait mode only. So I did the following Is that causing the issue?</p>
  <pre><code>extension UINavigationController{
      public override func shouldAutorotate() -&gt; Bool {
          if (UIDevice.currentDevice().orientation == UIDeviceOrientation.LandscapeLeft ||
              UIDevice.currentDevice().orientation == UIDeviceOrientation.LandscapeRight ||
              UIDevice.currentDevice().orientation == UIDeviceOrientation.Unknown) {
                  return false
          }
          else {
              return true
          }
      }
      
      public override func supportedInterfaceOrientations() -&gt; UIInterfaceOrientationMask {
          return [UIInterfaceOrientationMask.Portrait ,UIInterfaceOrientationMask.PortraitUpsideDown]
      }
      
  
  }
  </code></pre>
  <p><strong>Edit 1:</strong></p>
  <p>I am  using following code to move from one view controller not link from the storyboard. Is that causing issue now?</p>
  <pre><code> let storyboard = UIStoryboard(name: &quot;Main&quot;, bundle: nil)
          let secondViewController = storyboard.instantiateViewControllerWithIdentifier(&quot;HomeVC&quot;)
          presentViewController(secondViewController, animated: false, completion: nil)
  </code></pre>
  <p><strong>Edit 2:</strong></p>
  <p>Please check my following screenshots. Which are my settings for secondview controller</p>
  <p><a href="https://i.stack.imgur.com/cUrDm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/cUrDm.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/HNSfF.png" rel="noreferrer"><img src="https://i.stack.imgur.com/HNSfF.png" alt="enter image description here" /></a></p>
  <p><strong>Edit 3:</strong></p>
  <p>Here is my navigation controller attribute inspector
  <a href="https://i.stack.imgur.com/t7hcv.png" rel="noreferrer"><img src="https://i.stack.imgur.com/t7hcv.png" alt="enter image description here" /></a></p>