dismiss两级页面

A present B,B present C,直接由C dismiss A

UIViewController *presentViewController = [self presentingViewController];

        UIViewController *lastViewController = self;

        while (presentViewController) {

            id temp = presentViewController;

            presentViewController = [presentViewController presentingViewController];

            lastViewController = temp;

        }

        [lastViewController dismissViewControllerAnimated:YES completion:nil];

 

你可能感兴趣的:(dismiss两级页面)