-(void)fanhui{
NSArray *viewControllers = self.navigationController.viewControllers;
if (viewControllers.count > 1) {
if ([viewControllers objectAtIndex:viewControllers.count - 1] == self) {
//push方式
[self.navigationController popViewControllerAnimated:YES];
}
}else{
//present方式
[self dismissViewControllerAnimated:NO completion:nil];
}
}
网友评论