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