iPhone - dismiss multiple ViewControllers

后端 未结 22 3105
粉色の甜心
粉色の甜心 2020-11-28 04:46

I have a long View Controllers hierarchy;

in the first View Controller I use this code:

SecondViewController *svc = [[SecondViewController alloc] i         


        
22条回答
  •  半阙折子戏
    2020-11-28 05:20

    Dismiss the top VC animated and the other ones not. If you hace three modal VC

    [self dismissModalViewControllerAnimated:NO]; // First
    [self dismissModalViewControllerAnimated:NO]; // Second
    [self dismissModalViewControllerAnimated:YES]; // Third
    

    EDIT: if you want to do this only with one method, save you hierarchy into an array of VC and dismiss the last object animated and the other ones not.

提交回复
热议问题