[英]Programmatically push to view controller [2] in a navigation stack, and unwind to [1]
[英]How can I push the next view controller on a navigation controller programmatically?
如何以编程方式(无需按钮)将下一个视图控制器按入导航控制器?
我知道如何实例化并呈现一个新的控制器如下
var next = self.storyboard?.instantiateViewControllerWithIdentifier("PlaceInfo") as! PlaceInfoController
self.presentViewController(next, animated: false, completion: nil)
但我想推送到导航控制器上的下一个视图控制器。 我尝试了下面的self.navigationController?.pushViewController()但没有成功
var next = self.storyboard?.instantiateViewControllerWithIdentifier("PlaceInfo") as! PlaceInfoController
self.navigationController?.pushViewController(next, animated: true)
您是否尝试过使用performSegueWithIdentifier
?
在此处了解更多有关此的信息:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.