判断UIViewController是使用pop,dismiss返回到上级视图控制器
@(编程笔记)[iOS开发]
if self.navigationController?.topViewController == self, self.navigationController?.viewControllers.first != self {
self.navigationController?.popViewController(animated: true)
} else {
self.dismiss(animated: true, completion: nil)
}
网友评论