Skip to content

Instantly share code, notes, and snippets.

@328
Created April 5, 2018 05:59
Show Gist options
  • Save 328/2f0332e146b37b3f497f7d0616cb6474 to your computer and use it in GitHub Desktop.
Save 328/2f0332e146b37b3f497f7d0616cb6474 to your computer and use it in GitHub Desktop.
WKWebView テスト
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