Created
April 5, 2018 05:59
WKWebView テスト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import WebKit | |
class ViewController: UIViewController { | |
let wkWebView = WKWebView() | |
var backButton: UIButton! | |
var forwadButton: UIButton! | |
var targetUrl = "http://localhost:8080/refrects" | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |
wkWebView.frame = view.frame | |
let urlRequest = URLRequest(url:URL(string:targetUrl)!) | |
wkWebView.load(urlRequest) | |
view.addSubview(wkWebView) | |
} | |
override func didReceiveMemoryWarning() { | |
super.didReceiveMemoryWarning() | |
// Dispose of any resources that can be recreated. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment