如何通过单键操作解除所有推送和呈现的屏幕

问题描述 投票:1回答:1

我有3个视图控制器qazxsw poi,qazxsw poi,qazxsw poi

在主页changepassword按钮操作我将屏幕推入HomePageController

ChangePasswordViewController

现在我出现了屏幕PasswordChangedDoneControllerChangePasswordViewController

let vc = self.storyboard?.instantiateViewController(withIdentifier: "ChangePasswordViewController")as! ChangePasswordViewController
self.navigationController?.pushViewController(vc, animated: true)

现在我想和ChangePasswordViewController里面的Gotit Button Action一起去PasswordChangedDoneController。在这里,我想一次性删除push和present。

ios swift dismiss presentviewcontroller
1个回答
0
投票

您可以使用此函数弹出给定控制器的类类型

let vc = self.storyboard?.instantiateViewController(withIdentifier: "PasswordChangedController")as! PasswordChangedDoneController
self.navigationController?.present(vc, animated: true, completion: nil)

:)

© www.soinside.com 2019 - 2024. All rights reserved.