title: UIPickerView "didSelectRow" selection with button leading to url
body: <p>I have a picker set up and want to have the user make a selection then tap a button which leads to a url. This is what I have so far:-</p>
  
  <pre><code>class PickerViewController: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource {
      @IBOutlet weak var picker: UIPickerView!
      @IBOutlet weak var label: UILabel!
  
      var url = NSURL(string: "http://www.google.com")
      var pickerData: [String] = [String]()
      var pickerSites: [String] = [String]()
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          self.picker.delegate = self
          self.picker.delegate = self
  
          pickerData = ["Google", "Facebook"]
          pickerSites = ["http://www.google.com", "http://www.facebook.com"]
      }
  
      func numberOfComponentsInPickerView(pickerView: UIPickerView) -&gt; Int {
          return 1
      }
  
      func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -&gt; Int {
          return pickerData.count
      }
  
      func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -&gt; String? {
          return pickerData[row]
      }
  
      func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
          label.text = pickerSites[row]
      }
  
      siteBtn.addTarget(self, action: "didTapSite", forControlEvents: .TouchUpInside)
  
      @IBAction func sitesBtn(sender: AnyObject) {
          UIApplication.shared().openURL(NSURL(string: "http://www.google.com")!)
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  }
  </code></pre>
  
  <p>I've connected the "siteBtn" to a button on the screen. The picker and text label were working fine until I added the code for the button. I'm not sure if I've put the button code in the correct place. I know that I need the button to connect with the picker "didSelectRow" and that the "pickerData" list needs to correlate to the "pickerSites" list but I'm stuck.</p>
  
  <p>Any help would be much appreciated.</p>