📅  最后修改于: 2022-03-11 15:01:00.639000             🧑  作者: Mango
let viewControllers: [UIViewController] = self.navigationController!.viewControllers
for aViewController in viewControllers {
if aViewController is YourViewController {
self.navigationController!.popToViewController(aViewController, animated: true)
}
}