How to dismiss the two or more dismissModalViewController?

后端 未结 5 1158
孤城傲影
孤城傲影 2020-12-19 11:26

I need to dismiss the two modal view controllers, I know how to pop two or more view controllers

        UINavigationController* navController = self.navigat         


        
5条回答
  •  天涯浪人
    2020-12-19 12:04

    From the docs for -[UIViewController dismissModalViewController]:

    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.

提交回复
热议问题