Friday, May 12, 2017
How to Create a WEB VIEW in Swift IOS
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. | |
} | |
} |
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment