IOS界面推界面一般push和present
例如A->B->C 那C回到A该怎么办呢?C直接调用下面的方法就可以回到A
present推界面的方法
-(void)dismissModalStack {
UIViewController *vc =self.presentingViewController;
while (vc.presentingViewController) {
// while (![vc isKindOfClass:[PersonContentViewController class]]){ //dismiss到指定的界面
vc = vc.presentingViewController;
}
[vc dismissViewControllerAnimated:YES completion:NULL];
}
push推界面的方法
- (void)popToRootModalStack
{
[self.navigationController popToRootViewControllerAnimated:YES];
}