Change detail to open in SFSafariViewController. Issue #611

This commit is contained in:
Maurice Parker 2019-04-21 06:41:59 -05:00
parent 4592eb6a43
commit e6feef5b11

View File

@ -10,6 +10,7 @@ import UIKit
import WebKit import WebKit
import Account import Account
import Articles import Articles
import SafariServices
class DetailViewController: UIViewController { class DetailViewController: UIViewController {
@ -142,7 +143,8 @@ extension DetailViewController: WKNavigationDelegate {
let components = URLComponents(url: url, resolvingAgainstBaseURL: false) let components = URLComponents(url: url, resolvingAgainstBaseURL: false)
if components?.scheme == "http" || components?.scheme == "https" { if components?.scheme == "http" || components?.scheme == "https" {
UIApplication.shared.open(url) let vc = SFSafariViewController(url: url)
present(vc, animated: true)
decisionHandler(.cancel) decisionHandler(.cancel)
} else { } else {
decisionHandler(.allow) decisionHandler(.allow)