ios - 稍后在导航 Controller 的层次结构中抓取 View

标签 ios xcode swift uinavigationcontroller

我有一个导航 Controller ,在堆栈中有几个 View Controller 。在第二个 View 中,我使用 presentViewController(...) 呈现了一个未嵌入导航 Controller 的新 View 。用户完成此个人 View 后,我想返回到以编程方式呈现个人 View 的第二个 View 。但是,当我 presentViewController(...) 到第二个 View 时,它不再嵌入导航 Controller 中。

我怎样才能回到第二个 View 而不必回到 Root View Controller ?谢谢!

最佳答案

假设您当前位于第二个 View Controller 呈现的 View Controller 中:

UIViewController *secondViewController = self.presentingViewController;

[self dismissViewControllerAnimated:YES completion:^{
    [secondViewController.navigationController popToViewController:secondViewController animated:YES];
}];

关于ios - 稍后在导航 Controller 的层次结构中抓取 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31498267/

相关文章:

ios - 使用 Xcode 6 beta 5 编译 Storyboard文件时出错

ios - 如何在 iOS swift 2 中为 uisearchbar 过滤大数组

iOS Facebook Graph API 使用 "next"或 "previous"Url 使用 SDK 进行分页

ios - Safari Web 检查器不显示重定向

iphone - 我可以在我的 AppDelegate 中接收摇动事件吗?

iphone - 如何在 UITableView 单元格中设置背景图像?

ios - 为什么 Xcode 不会将一些工件作为文件夹上下文提交的一部分提交?

iOS lazy var UIBarButtonItem 目标问题

ios - 什么 UIKit 对象控制 “Look Up"弹出外观?

ios - 如何获取图片的路径?