我正试图解雇一位 VC 并提出一位新的 VC。但我不希望旧的 VC 继续存在。我使用下面的代码来关闭当前的 VC 并呈现新的 VC。但这样一来,解雇和出席之间就有一个时间间隔。我不希望用户注意到这一点。所以,我想先介绍一下新的 VC,然后再驳回之前的 VC。有什么办法可以做到这一点吗?
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let destinationController = self.storyboard?.instantiateViewController(withIdentifier: "login") as! Login
let presentingVC = self.presentingViewController
self.dismiss(animated: false, completion: { () -> Void in
presentingVC!.present(destinationController, animated: true, completion: nil)
})
我认为最好的办法是当你真正回去时解雇当前的风险投资家。这意味着,展示您的destinationController
使用当前的 VC,然后当您返回时,关闭两个 VC
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)