2019-07-31 导航或覆盖返回时pop 还是 dis 自动
2019-07-31 本文已影响0人
名a字太难搞了
-(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];
}
}