打开UIViewController,不要显示UINavigationController导航栏

Ari*_*erá 1 iphone objective-c uinavigationcontroller ios swift

我的视图中有导航控制器.

在此输入图像描述

在我的View Controller中有一个didSelectRowAtIndexPath带开关的方法.在第一个单元格中,我想打开我的新视图"Empresa",我使用这个:

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

和工作,但不是apear导航控制器.像这样查看apear:

在此输入图像描述

Anb*_*hik 5

在这个地方

 self.presentViewController(vc, animated: true, completion: nil)
Run Code Online (Sandbox Code Playgroud)

使用

self.navigationController?.pushViewController(vc, animated: true)
Run Code Online (Sandbox Code Playgroud)

更新

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