title: Swift Tabbed Bar 2 URLs
body: <p>I'm writing a simple swift app - I have two tabs at the bottom calling different URLs. I can't differentiate between them so both tabs load the first URL.</p>
  
  <pre><code>import UIKit
  import WebKit
  
  // Add WKWebView programmatically
  
  
  class ViewController2: UIViewController {
      var webView : WKWebView
      required init(coder aDecoder: NSCoder) {
          self.webView = WKWebView(frame: CGRect(x: 0, y: 0, width: 414, height: 736))
          super.init(coder: aDecoder)!
      }
      override func viewDidLoad() {
          super.viewDidLoad()
          view.addSubview(webView)
          webView.translatesAutoresizingMaskIntoConstraints = false
          let views = ["webView" : webView]
          let h = NSLayoutConstraint.constraints(withVisualFormat: "H:|[webView]|", options: [], metrics: nil , views: views)
          let w = NSLayoutConstraint.constraints(withVisualFormat: "V:|[webView]|", options: [], metrics: nil, views: views)
          view.addConstraints(h)
          view.addConstraints(w)
          let url = NSURL(string: "https://bing.com")
          let urlRequest = URLRequest(url: url! as URL)
          webView.load(urlRequest)
      }
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  }
  
  class ViewController3: UIViewController {
      var webView1 : WKWebView
      required init(coder aDecoder: NSCoder) {
          self.webView1 = WKWebView(frame: CGRect(x: 0, y: 0, width: 414, height: 736))
          super.init(coder: aDecoder)!
      }
      override func viewDidLoad() {
          super.viewDidLoad()
          view.addSubview(webView1)
          webView1.translatesAutoresizingMaskIntoConstraints = false
          let views1 = ["webView1" : webView1]
          let h = NSLayoutConstraint.constraints(withVisualFormat: "H:|[webView1]|", options: [], metrics: nil , views: views1)
          let w = NSLayoutConstraint.constraints(withVisualFormat: "V:|[webView1]|", options: [], metrics: nil, views: views1)
          view.addConstraints(h)
          view.addConstraints(w)
          let url1 = NSURL(string: "https://www.google.com")
          let urlRequest = URLRequest(url: url1! as URL)
          webView1.load(urlRequest)
      }
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  }
  </code></pre>
  
  <p>I have tried to separate the url requests and I'm sure its a simple error on my part as I'm very new to swift and Xcode!</p>