ios - 如何以编程方式将下一个 View Controller 推送到导航 Controller 上?

标签 ios swift

如何以编程方式在导航 Controller 上推送下一个 View Controller (无需按钮)?

我知道如何实例化并呈现一个新的 Controller 如下

 var next = self.storyboard?.instantiateViewControllerWithIdentifier("PlaceInfo") as! PlaceInfoController         
 self.presentViewController(next, animated: false, completion: nil)

但我想推送到导航 Controller 上的下一个 View Controller 。 我尝试了以下 self.navigationController?.pushViewController() 但没有成功

 var next = self.storyboard?.instantiateViewControllerWithIdentifier("PlaceInfo") as! PlaceInfoController
 self.navigationController?.pushViewController(next, animated: true)

最佳答案

关于ios - 如何以编程方式将下一个 View Controller 推送到导航 Controller 上?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30949011/

相关文章:

ios - 出现键盘时 UITableViewController 不 ScrollView

swift - 不使用 Tint 更改 NavigationBar 和系统颜色

ios - 使用 Realm 和 Swift 的具有多个部分的 UITableView

ios - 从 iOS 授权流程中完全阻止 Spotify 注册

ios - 解析分析自定义事件未注册

ios - 将数据传递到两个选项卡栏 View Controller

ios - 更新 : How to checkmark select items from selection List by clicking Tableview cell in swift

swift - 添加为 subview 时 UIPageViewController 无法识别滑动

ios - 自定义 y 轴的编程解决方案

ios - UISwitch 无法正常工作