I have a long View Controllers hierarchy;
in the first View Controller I use this code:
SecondViewController *svc = [[SecondViewController alloc] i
id vc = [self presentingViewController]; id lastVC = self; while (vc != nil) { id tmp = vc; vc = [vc presentingViewController]; lastVC = tmp; } [lastVC dismissViewControllerAnimated:YES completion:^{ }];