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")
    }

}

 

'컴퓨터 > iOS' 카테고리의 다른 글

iOS 간단한 웹뷰 처리  (0) 2020.08.30

+ Recent posts