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)
}
}