Skip to content

Instantly share code, notes, and snippets.

@growvv
Created November 22, 2020 06:50
Show Gist options
  • Save growvv/ceac2f3492edc4fffe1d5f3f15c2bbbf to your computer and use it in GitHub Desktop.
Save growvv/ceac2f3492edc4fffe1d5f3f15c2bbbf to your computer and use it in GitHub Desktop.
//
// ViewController.swift
// ExampleUIWebView
//
// Created by admin on 2020/11/22.
//
import UIKit
import WebKit
class ViewController: UIViewController, WKUIDelegate {
var webView: WKWebView!
override func loadView() {
super.loadView()
let webConfiguration = WKWebViewConfiguration()
webView = WKWebView(frame: .zero, configuration: webConfiguration)
webView.uiDelegate = self
view = webView
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
let myURL = URL(string: "https://apple.com")
let myRequest = URLRequest(url: myURL!)
webView.load(myRequest)
}
}
@growvv
Copy link
Author

growvv commented Nov 22, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment