【问题标题】:dismissViewControllerAnimated doesn't call it's completion handledismissViewControllerAnimated 不称其为完成句柄
【发布时间】:2017-06-15 18:28:39
【问题描述】:

dismissViewController 不会一直调用它正在完成的处理程序。我正在呈现第一个视图,当我关闭它时,它会调用完成处理程序,我正在呈现 2 个视图。在关闭第二个视图时,不会调用完成处理程序。这是我的代码:

if self.presentedViewController != nil {
// Checking it to make sure that I have presentedViewController and it is not dismissed already.
    self.dismissViewControllerAnimated(false, completion: {            
         //Present 2nd controller.
    })
}

【问题讨论】:

标签: ios swift uiviewcontroller presentviewcontroller ios9.3


【解决方案1】:

您无法从已解散的 UIViewController 中呈现第二个 UIViewController,因为您正在解散“演示者”。

您需要将“当前第二个控制器”放在您的 PRESENTING UIViewController (展示)您要关闭的 UIViewController 之前。

基本上,您关闭 UIViewController,然后当您返回展示的 VC 时,您展示的是第二个控制器。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-13
    • 1970-01-01
    • 2016-09-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多