我推了四屏 ScreenOne >> ScreenTwo >> ScreenThree >> ScreenFour
我现在在ScreenFour,我想回到ScreenTwo
在 Swift 中它是这样工作的:
if let viewControllers: [UIViewController] = self.navigationController!.viewControllers {
for vc in viewControllers
{
if (vc is SecondViewController)
{
self.navigationController!.popToViewController(vc, animated: true)
}
}
}
Run Code Online (Sandbox Code Playgroud)
我如何在颤振中执行此操作。
请给出解决方案,谢谢。