title: How to use picker view value in Swift?
body: <p>I have a picker view and it works well, but I don't know how to use the picked value.
  I'd like to print the selected value on each selectedValue1.text and selectedValue2.text.</p>
  
  <p>my array(arr) has 21 index from 0 to 20.</p>
  
  <p>for example,
  in the left picker view, you select 1 and in the right picker view, you select 10 then,
  selectedValue1.text should show 1 and selectedValue.text should show 10. I'd like it to work this way.</p>
  
  <pre><code>class Setup: UIViewController,UIPickerViewDelegate,UIPickerViewDataSource {
  @IBOutlet weak var selectedValue1: UILabel!
  @IBOutlet weak var selectedValue2: UILabel!
  
       var selectRow = 0
  
          var numbers = arr
  
  func numberOfComponents(in pickerView: UIPickerView) -&gt; Int {
      return 2
  
  }
  
  func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -&gt; Int {
     return numbers.count
  }
  
  func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -&gt; String? {
      return numbers[row]
  
  }
  
  func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
      selectRow = row
  }
  </code></pre>