iOS- 如何dismissViewController到指定控制器

present到最底层控制器

-(void)dismissToRootViewController

{

UIViewController*vc =self;

while(vc.presentingViewController) {

vc = vc.presentingViewController;

}

[vcdismissViewControllerAnimated:YEScompletion:nil];

}


连续dismissViewController两次

[self.presentingViewController.presentingViewController dismissViewControllerAnimated:YES completion:nil];

你可能感兴趣的:(iOS- 如何dismissViewController到指定控制器)