Change detail to open in SFSafariViewController. Issue #611
This commit is contained in:
parent
4592eb6a43
commit
e6feef5b11
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user