gpt4 book ai didi

ios - 如何关闭当前 View Controller 和parentviewcontroller?

转载 作者:搜寻专家 更新时间:2023-10-31 08:23:35 24 4
gpt4 key购买 nike

我像这样呈现两个 View Controller

self.presentViewController(choosePlace, animated: true, completion: nil)
self.presentViewController(shareController, animated: true, completion: nil)

我想像这样解雇他们:

println("parent \(self.parentViewController)")
self.dismissViewControllerAnimated(true, completion: {

self.parentViewController?.dismissViewControllerAnimated(true, completion: nil)
})

self.parentViewController 始终为 nil。如何同时解雇两个?

最佳答案

您可以:

self.dismissViewControllerAnimated(true, completion: { 
self.presentingViewController?.dismissViewControllerAnimated(true, completion: nil)
})

因此,请确保按顺序呈现 View Controller :

parentViewController -> choosePlace -> shareController

(箭头表示“self.presentViewController”)

关于ios - 如何关闭当前 View Controller 和parentviewcontroller?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31103881/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com