Dismissing Modal View Controllers

后端 未结 4 1525
温柔的废话
温柔的废话 2021-01-21 20:25

View Controller A presents View Controller B modally, which has a button to present View Controller C modally.

Here is my flow:

A presents B which presen         


        
4条回答
  •  执念已碎
    2021-01-21 20:52

    I think that you can not do it. Read again the documentation for dimissing the modal view controller

    If you present several modal view controllers in succession, and thus build a stack of modal view controllers, calling this method on a view controller lower in the stack dismisses its immediate child view controller and all view controllers above that child on the stack. When this happens, only the top-most view is dismissed in an animated fashion; any intermediate view controllers are simply removed from the stack. The top-most view is dismissed using its modal transition style, which may differ from the styles used by other view controllers lower in the stack.

    That means if you dismiss B, you will dismiss C as well

提交回复
热议问题