Yes there is.
UIViewController offers various methods for rejecting the view controller, depending on whether you were represented by the method or not. It:
-(void)dismissModalViewControllerAnimated:(BOOL)animated;
You will need to fire them one by one. It also takes time to read Apple's View Programming Guide .
Using the UINavigationController , you can go to any view controller using:
-(NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated;
Alternatively, another way allows you only once:
-(UIViewController *)popViewControllerAnimated:(BOOL)animated;
user971401
source share