ViewController.swift

//
//  ViewController.swift
//  test
//
//  Created by 이정현 on 2020/08/08.
//  Copyright © 2020 test. All rights reserved.
//

import UIKit
import WebKit

class ViewController: UIViewController, WKUIDelegate {
    
    @IBOutlet weak var webView: WKWebView!
    
    override func loadView() {
        let webConfiguration = WKWebViewConfiguration()
        webView = WKWebView(frame: .zero, configuration: webConfiguration)
        webView.uiDelegate = self
        view = webView
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        let myURL = URL(string:"https://www.google.co.kr/")
        let myRequest = URLRequest(url: myURL!)
        webView.load(myRequest)
        print("webView.load")
    }

}

 

+ Recent posts