Created
December 1, 2017 21:39
-
-
Save artygus/036714dc69cf538abe185d7f8ae19ada to your computer and use it in GitHub Desktop.
This file contains 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 | |
class ViewController: UIViewController { | |
@IBOutlet weak var myWebView: UIWebView! | |
@IBOutlet weak var btnSwitch: UIButton! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |
let url = NSURL (string: "https://coub.com"); | |
let requestObj = URLRequest(url: url! as URL); | |
myWebView.loadRequest(requestObj); | |
} | |
override func didReceiveMemoryWarning() { | |
super.didReceiveMemoryWarning() | |
// Dispose of any resources that can be recreated. | |
} | |
@IBAction func kickSwitchBtn(_ sender: Any) { | |
let webView:UIWebView = UIWebView(); | |
let url = NSURL (string: "https://coub.com"); | |
let requestObj = URLRequest(url: url! as URL); | |
webView.loadRequest(requestObj); | |
self.view.addSubview(webView); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment