Aris Guimerá Aris Guimerá - 7 months ago 23
Swift Question

Open UIViewController, don't show UINavigationController navigation bar

I have Navigation controller from my views.

enter image description here

In my View Controller have a

didSelectRowAtIndexPath
method with a switch. In first cell I want to open my new view "Empresa", I use this:

let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewControllerWithIdentifier("Empresa")
self.presentViewController(vc, animated: true, completion: nil)


And work, but not apear navigation controller. View apear like this:

enter image description here

Answer

in this place

 self.presentViewController(vc, animated: true, completion: nil)

use

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

update

 let vc = self.storyboard?.instantiateViewControllerWithIdentifier("Empresa") as yourviewcontrollerName
  self.navigationController?.pushViewController(vc, animated: true)