以下是我的代码存在 Safari 视图控制器
if let url = URL(string: "https://www.ggogle.com.com/") {
let config = SFSafariViewController.Configuration()
config.entersReaderIfAvailable = true
let vc = SFSafariViewController(url: url, configuration: config)
present(vc, animated: false)
}
上面的代码调用 viewWillDisappear 但在关闭呈现的视图控制器时不调用 viewWillAppear。
还发现视图被关闭后 viewWillDisappear 根本没有为任何其他 pushViewController 调用
如何解决这个问题?
对此进行更新:
尝试导航控制器并设置其委托并实现以下方法
navigationController:willShowViewController:animated:
navigationController:didShowViewController:animated:
这也不起作用。
更新此尝试以下代码
vc.modalPresentationStyle = .currentContext
但是使用此标签栏不会隐藏,控制器不会全屏显示,并且目前没有隐藏底栏之类的选项。