【发布时间】:2017-03-16 05:33:50
【问题描述】:
我有两个视图控制器。通过按下按钮使用下面的代码,我已经从一个视图导航到另一个视图。
*let secondViewController = self.storyboard!.instantiateViewControllerWithIdentifier("NotificationController") as! NotificationController
self.navigationController!.pushViewController(secondViewController, animated: true)*
对于后面,我使用下面的代码在 bar 按钮上使用 bar button click for back。
self.navigationController?.popViewControllerAnimated(true)
所以我的问题是,如果我不断地从一个视图转到另一个视图,那么它会添加到堆栈中。我只想显示另一个视图,当它已经添加到堆栈中以停止添加它。它只添加一次。
【问题讨论】:
-
yourViewController.view.window != nil
标签: ios swift uiviewcontroller