Skip to content

Instantly share code, notes, and snippets.

@tigawa
Created January 3, 2015 14:47
Show Gist options
  • Save tigawa/9043ba5afe98131e4fba to your computer and use it in GitHub Desktop.
Save tigawa/9043ba5afe98131e4fba to your computer and use it in GitHub Desktop.
import UIKit
import WebKit
class ViewController: UIViewController{
var webview : WKWebView?
override func viewDidLoad() {
super.viewDidLoad()
// デバイスのCGRectを取得
var deviceBound : CGRect = UIScreen.mainScreen().bounds
// WKWebView
self.webview = WKWebView(frame: CGRectMake(0, 20, deviceBound.size.width, deviceBound.size.height - 20))
self.webview?.loadRequest(NSURLRequest(URL: NSURL(string: "http://www.google.co.jp")!))
self.view.addSubview(self.webview!)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment