ios - 导航 Controller 和 View Controller

标签 ios swift uinavigationcontroller

当我按下导航 Controller 第一个 View 中的按钮时,我需要返回主视图......

我已经连接了一个简单的 View ,并且该 View 转到导航 Controller ..

ViewController --> 导航 Controller --> 导航 View

<----------------------------------------------

我怎样才能做到这一点......

enter image description here

最佳答案

你想返回到顶层Root ViewController:

navigationController?.popTopRootViewControllerAnimated(true)

如果你想返回到之前的viewController:

navigationController?.popViewControllerAnimated(true)

关于ios - 导航 Controller 和 View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32359485/

相关文章:

iPhone - 在 UITextfield 下方显示错误消息的最佳方式是什么

ios - Swift:如何以编程方式推进容器 View 内的 UIPageViewController?

ios - 状态栏色调和隐藏栏滑动

iphone - 如何创建从屏幕顶部推送的 UINavigationController?

ios - 如何在 UINavigationController 标题中的图 block 旁边添加图标?

objective-c - TableView 背景图像遍历单元格文本标签

ios - 以编程方式在 iOS 上创建了一个按钮,但按下时没有任何 Action

swift - 命令因信号 : Segmentation fault: 11 while emitting IR SIL function 而失败

swift - 当用户在 UITextField 中输入数字时,如何添加分组分隔符?

swift - NSAttributedString 与 Swift 2.1 中的属性