Created
April 5, 2018 05:59
-
-
Save 328/2f0332e146b37b3f497f7d0616cb6474 to your computer and use it in GitHub Desktop.
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