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:
在这个地方
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)
| 归档时间: |
|
| 查看次数: |
351 次 |
| 最近记录: |