int i =0; UIViewController *vc =self; while(vc.presentingViewController!=nil) { i++; if(i==3) { break; } vc = vc.presentingViewController; } [vc dismissViewControllerAnimated:YES completion:^{ }];
int i =0; UIViewController *vc =self; while(vc.presentingViewController!=nil) { i++; if(i==3) { break; } vc = vc.presentingViewController; } [vc dismissViewControllerAnimated:YES completion:^{ }];