Created
January 3, 2015 14:47
-
-
Save tigawa/9043ba5afe98131e4fba to your computer and use it in GitHub Desktop.
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{ | |
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