Friday, May 12, 2017

How to Create a WEB VIEW in Swift IOS

No comments :
import UIKit
import WebKit
class ViewController: UIViewController, UIWebViewDelegate {
var webView: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
webView = UIWebView(frame: UIScreen.main.bounds)
webView.delegate = self
view.addSubview(webView)
if let url = URL(string: "http://omnipopmag.com") {
let request = URLRequest(url: url)
webView.loadRequest(request)
}
}
override func viewWillAppear(_ animated: Bool) {
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}

No comments :

Post a Comment