This Video is tutorial to show" Multiple Webview in One View Controller with buttons" for iOS with language Swift 4.2. If this video helped, just subscribe for more tutorials.
Devices: Apple Products.
Video is meant for Beginners who would like to learn App development for Apple.
Tool: Xcode 10.1
Language:- Swift 4.2
Source Code: -
@IBAction func appleURL(_ sender: Any) {
let ViewController:UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let desVC = ViewController.instantiateViewController(withIdentifier: "WebViewVC") as! WebViewVC
desVC.urlWebsite = "https://www.apple.com"
self.present(desVC, animated: false, completion: nil)
}
@IBAction func googleURL(_ sender: Any) {
let ViewController:UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let desVC = ViewController.instantiateViewController(withIdentifier: "WebViewVC") as! WebViewVC
desVC.urlWebsite = "https://www.google.com"
self.present(desVC, animated: false, completion: nil)
}
// Webview via Segue
/*override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
let websiteController = segue.destinationViewController as YourVCName
if segue.identifier == "website1" {
websiteController.urlWebsite = "google.com"
} else if segue.identifier == "website2" {
websiteController.urlWebsite = "stackoverflow.com"
}
}*/
// TableView
/* func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.row == 0 {
let ViewController:UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let desVC = ViewController.instantiateViewController(withIdentifier: "WebViewVC") as! WebViewVC
desVC.urlWebsite = "https://www.apple.com"
self.present(desVC, animated: false, completion: nil)
}
if indexPath.row == 1 {
let ViewController:UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let desVC = ViewController.instantiateViewController(withIdentifier: "WebViewVC") as! WebViewVC
desVC.urlWebsite = "https://www.google.com"
self.present(desVC, animated: false, completion: nil)
}
}*/
If you like the video just Donate,
Paypal Donate- https://paypal.me/SwiftKat