新翼设计网站建设公司,潍坊专升本培训机构,网站的首页怎么做的,wordpress音乐墙在 Swift 中#xff0c;可以通过检查当前视图控制器的 presentingViewController 属性来判断是通过 push 过来的页面还是 present 过来的页面。
下面是一个示例代码#xff0c;展示如何判断是通过 push 还是 present 过来的页面#xff1a;
if let presentingViewControll…在 Swift 中可以通过检查当前视图控制器的 presentingViewController 属性来判断是通过 push 过来的页面还是 present 过来的页面。
下面是一个示例代码展示如何判断是通过 push 还是 present 过来的页面
if let presentingViewController self.presentingViewController {// 通过 present 过来的页面self.dismiss(animated: true, completion: nil)
} else if let navigationController self.navigationController {// 通过 push 过来的页面navigationController.popViewController(animated: true)
}