//
//  StoryBoardableWKWebView.swift
//  MCPlus
//
//  Created by seo ha on 18/03/2019.
//  Copyright © 2019 KangSH. All rights reserved.
//

import Foundation
import UIKit
import WebKit
/**
 wk webview 를 storyboard 에서 사용가능

 */
class StoryBoardableWKWebView: WKWebView {
    required init?(coder: NSCoder) {
        
        if let _view = UIView(coder: coder) {
            super.init(frame: _view.frame, configuration: WKWebViewConfiguration())
//            autoresizingMask = _view.autoresizingMask
            self.translatesAutoresizingMaskIntoConstraints = false
            self.setNeedsUpdateConstraints()

        } else {
            return nil
        }
    }
    
    func loadUrl(string: String) {
        if let url = URL(string: string) {
            load(URLRequest(url: url))
        }
    }
}
