Created
June 12, 2018 15:58
-
-
Save byJeevan/556690de71f4eae245370edf0389f226 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 ViewController: UIViewController, WKNavigationDelegate { | |
@IBOutlet weak var demoWebView: WKWebView! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
let url = URL(string: "https://ioscreator.com")! | |
demoWebView.load(URLRequest(url: url)) | |
demoWebView.navigationDelegate = self | |
} | |
override func didReceiveMemoryWarning() { | |
super.didReceiveMemoryWarning() | |
// Dispose of any resources that can be recreated. | |
} | |
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { | |
title = webView.title | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment