import UIKit
class ViewController: UIViewController, UIWebViewDelegate {
@IBOutlet weak var webView: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
webView.delegate = self
if let url = URL(string: "http://apple.com") {
let urlRequest = URLRequest(url: url)
webView.loadRequest(urlRequest)
}
}
func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool {
return true
}
func webViewDidStartLoad(_ webView: UIWebView) {
}
func webViewDidFinishLoad(_ webView: UIWebView) {
}
func webView(_ webView: UIWebView, didFailLoadWithError error: Error) {
}
}
Last active
May 10, 2018 23:56
-
-
Save KentarouKanno/81b1d1facfa41cae4da2 to your computer and use it in GitHub Desktop.
UIWebView
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment