0
我试图修复一个编辑segue(在IB中显示),我可以单击工具栏上的“编辑报告详细信息”按钮,它会显示对'配置报告“视图控制器。显示Segue使用错误的presentationViewController,并导致错误的导航
但是,如果我点击取消,它会一直回到我的登录屏幕,因为presentsViewController是一个UINavigationController,即使它不应该。
这是故事板。 http://i.imgur.com/DK4HhpO.png
任何想法?
// MARK: Navigation
@IBAction func cancel(sender: UIBarButtonItem) {
// Depending on style of presentation (modal or push presentation), this view controller needs to be dismissed in two different ways.
let isPresentingInAddItemMode = presentingViewController is UINavigationController
if isPresentingInAddItemMode {
dismissViewControllerAnimated(true, completion: nil)
}
else {
// In this mode (push presentation), we need to pop the view controller to get rid of it, rather than dismissing
navigationController!.popViewControllerAnimated(true)
}
}