-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewController.swift
More file actions
58 lines (37 loc) · 1.26 KB
/
ViewController.swift
File metadata and controls
58 lines (37 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// ViewController.swift
// WebRequestTest
//
// Created by Miwand Najafe on 2016-02-26.
// Copyright © 2016 Miwand Najafe. All rights reserved.
//
import UIKit
import WebKit
class ViewController: UIViewController {
// @IBOutlet weak var container: UIView!
@IBOutlet weak var webView: UIWebView!
// var webView: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
// webView = WKWebView()
// container.addSubview(webView)
}
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
loadRequest("https://developer.apple.com/swift/blog/")
}
func loadRequest(urlString:String) {
let url = NSURL(string: urlString)!
let request = NSURLRequest(URL: url)
webView.loadRequest(request)
}
@IBAction func loadSwift(sender: AnyObject) {
loadRequest("https://developer.apple.com/swift/blog/")
}
@IBAction func loadGossip(sender: AnyObject) {
loadRequest("http://www.tmz.com/")
}
@IBAction func loadSteak(sender: AnyObject) {
loadRequest("http://primecutsblog.com/2008/11/06/why-i-love-steak-on-the-bone-and-why-you-should-too/")
}
}