关闭navigationController

时间:2015-09-01 20:43:49

标签: ios swift uibarbuttonitem

我有viewcontroller,它嵌入到navigationController中。当我单击此viewController中的UIBarButtonItem时,它将以模态方式呈现新的navigationController。我怎么能解雇这个navigationController?

我试过了,但是没有用?

self.navigationController?.popViewControllerAnimated(true)

2 个答案:

答案 0 :(得分:1)

尝试

self.dismissViewControllerAnimated(true, completion:nil)

答案 1 :(得分:-1)

try self.view.removeFromSuperview()