Apple Swift: Creating Webviews

47 Views
45ghesgd1
0
Published on 14 Oct 2018 / In SwiftLang

In this first swift tutorial, we will be making a webview!


code below


import UIKit

class ViewController: UIViewController {
var URLPath = "http://google.com"
@IBOutlet var WebView : UIWebView


override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
loadAddressURL()

}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}

func loadAddressURL() {
let requestURL = NSURL(string:URLPath)
let request = NSURLRequest(URL: requestURL)
WebView.loadRequest(request)
}


}

Show more
0 Comments sort Sort by