简体   繁体   English

dismissViewControllerAnimated关闭所有视图控制器到root [swift]

[英]dismissViewControllerAnimated close all view controller to root [swift]

let's say I've 4 view controller 让我说我有4个视图控制器

page 1 ----showdetail----> page 2 ----showdetail----> page 3 ----showdetail----> page 4 第1页 ---- showdetail ----> 第2页 ---- showdetail ----> 第3页 ---- showdetail ----> 第4页

I want to go back to page 3 from page 4 with self.dismissViewControllerAnimated(true, completion: nil) . 我想回到第4页的第3页,其中包含self.dismissViewControllerAnimated(true, completion: nil) It works fine in iOS 9 but it closes all view controller to page 1 when i try it in iOS 8 device 它在iOS 9中运行良好,但是当我在iOS 8设备中尝试它时,它会关闭所有视图控制器到第1页

You probably want to use Present Modally segue instead of Show Detail . 您可能希望使用Present Modally segue而不是Show Detail Here there is a good explanation for each kind of segues What's the difference between all the Selection Segues? 这里有一个很好的解释每种segues 所有选择段之间的区别是什么?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM