Commit 7e9839cf authored by Alex朱枝文's avatar Alex朱枝文

删除多余代码

parent a8d62d85
......@@ -581,26 +581,6 @@ extension YHH5WebViewVC {
decisionHandler(.allow)
}
// 辅助方法 - 显示消息
private func showMessage(_ message: String) {
// 替换原来的 MBProgressHUD
// 这里可以使用你偏好的提示框方案,比如:
// 方案1: 使用系统 Alert
let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert)
present(alert, animated: true)
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
alert.dismiss(animated: true)
}
// 方案2: 如果使用 MBProgressHUD
// MBProgressHUD.showAdded(to: self.view, animated: true)
// let hud = MBProgressHUD.showAdded(to: self.view, animated: true)
// hud.mode = .text
// hud.label.text = message
// hud.hide(animated: true, afterDelay: 2.0)
}
// 辅助方法 - 打开应用
private func openApp(with url: URL?) {
guard let url = url else { return }
......@@ -608,6 +588,7 @@ extension YHH5WebViewVC {
if UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
} else if url.absoluteString.hasPrefix("https://") || url.absoluteString.hasPrefix("http://") {
// 排除没加白名单导致应用没法打开导致崩溃
let safariViewController = SFSafariViewController(url: url)
safariViewController.dismissButtonStyle = .close
safariViewController.modalPresentationStyle = .fullScreen
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment