永发信息网

iOS判断当前ViewController是push还是present方式显示的

答案:1  悬赏:60  手机版
解决时间 2021-03-29 05:19
  • 提问者网友:记得曾经
  • 2021-03-28 22:27
iOS判断当前ViewController是push还是present方式显示的
最佳答案
  • 五星知识达人网友:琴狂剑也妄
  • 2021-03-28 23:01
if ([self respondsToSelector:@selector(dismissViewControllerAnimated:completion:)]) {
//判断1
[self dismissViewControllerAnimated:YES completion:nil];
} else if ([self.navigationController respondsToSelector:@selector(popViewControllerAnimated:)]) {
//判断2
[self.navigationController popViewControllerAnimated:YES];
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯