UIViewController *rootVC = self.presentingViewController; while (rootVC.presentingViewController) { rootVC = rootVC.presentingViewController; } [rootVC dismissViewControllerAnimated:YES completion:nil];