Created
January 20, 2021 04:37
-
-
Save jeksys/fadaab4a9631176a25aabd26bbdb5740 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import WebKit | |
class WebViewController: UIViewController, WKNavigationDelegate { | |
var webView: WKWebView! | |
private let url: URL | |
init(title: String, url: URL) { | |
self.url = url | |
super.init(nibName: nil, bundle: nil) | |
self.title = title | |
} | |
required init?(coder: NSCoder) { | |
fatalError("init(coder:) has not been implemented") | |
} | |
override func loadView() { | |
webView = WKWebView() | |
webView.navigationDelegate = self | |
view = webView | |
webView.load(URLRequest(url: url)) | |
navigationController?.navigationBar.isTranslucent = false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment