在我的ViewControllerA,中,我试图通过调用来显示ViewControllerB:
let VC2 = ViewControllerB()
VC2.modalPresentationStyle = UIModalPresentationStyle.OverCurrentContext
presentViewController(VC2, animated: true, completion: nil)因此,ViewControllerB的内容显示在ViewControllerA.的顶部。
在ViewControllerB,中按下按钮时,这称为:
dismissViewControllerAnimated(true, completion: nil)但是,不调用ViewControllerA的viewWillAppear。
如果删除行ViewControllerA,则调用VC2.modalPresentationStyle = UIModalPresentationStyle.OverCurrentContext的viewWillAppear。
在使用ViewControllerA时,不调用UIModalPresentationStyle.OverCurrentContext的viewWillAppear。在这种情况下,如何检测ViewControllerB是否在ViewControllerA中被驳回?我想在ViewControllerA,中运行一些代码,但在ViewControllerB.中不使用completion of dismissViewControllerAnimated
发布于 2015-11-02 10:24:25
为什么不在ViewControllerB上创建自己的完成块呢?您可以在ViewControllerA上创建ViewControllerA实例时分配它,然后在调用ViewControllerB上的dismissViewControllerAnimated时调用它。
https://stackoverflow.com/questions/33475156
复制相似问题