title: Loading multiple URL's with different buttons using one UIWebView -- iOS Swift
body: <p>I have a ViewController with a button, I was able to link it (through segue) with another ViewController that contains a UIWebView.
  When I click the button, it segues into the ViewController and loads the webpage that I have specified.</p>
  
  <p>This is my code in my VC that contains UIWebView:</p>
  
  <pre><code>func displayURL ()
      {
      let myURLString = "http://google.com"
      let myURL = NSURL(string: myURLString)
      let myURLRequest = NSURLRequest(URL: myURL!)
      myWebView.loadRequest(myURLRequest)   
      }
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
             displayURL ()
      }
  </code></pre>
  
  <p>I now want to add multiple buttons that go to different Web Pages using only ONE UIWebView, but I'm not sure how to do it? </p>
  
  <p>I tried doing it where I did : </p>
  
  <pre><code>if segue.identifier = website1
  {
  load website1 
  } else etc..
  </code></pre>
  
  <p>but wasn't able to get it to work.</p>
  
  <p>Currently, clicking the button is just seguing into the next VC, but I think I would hve to declare what website it is within the button itself.</p>
  
  <p>Is there anyway to do something like: </p>
  
  <pre><code>if (button1 is clicked){
  go to this website
  }
  else..
  </code></pre>
  
  <p>Any help would be appreciated!!</p>