title: how to place 2 Pick Views in the same controller in Swift 3
body: <p>I'm trying to place 2 pick views in one view controller.  I tried setting different tags for them.  But both views have the "choices" array in them.  I control-dragged both and set to data source and delegate. I also tried the below code.  Thanks in advance.</p>
  
  <pre><code>import Foundation
  import UIKit
  
  class SecondViewController: UIViewController, UIPickerViewDelegate,    UIPickerViewDataSource {
      var model =  Model()
      @IBOutlet weak var hoursTakenText: UITextField!
      @IBOutlet weak var PickerView2: UIPickerView!
      @IBOutlet weak var pickerView1: UIPickerView!
      let choices2 = ["0","0.7","1.0"]
      let choices: [String] = (1...90).map {  String($0)}
      @IBAction func hoursTaken(_ sender: Any) {
          subView.isHidden = false
      }
      @IBOutlet weak var subView: UIView!
      func numberOfComponents(in pickerView: UIPickerView) -&gt; Int {
          return 1
      }
      func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -&gt; String? {
          if pickerView == pickerView1 {
              return choices[row]}
          else {
              return choices2[row]
          }
      }
  
      func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -&gt; Int {
          if pickerView == pickerView1 {
              return choices.count}
          else{
              return choices2.count
          }
      }
      //choices[row]: [String] = (1...10).map { "Option " + String(format: "%2d", $0)}
      func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -&gt; UIView {
          let label = (view as? UILabel) ?? UILabel()
          label.font = UIFont(name: "Verdana", size: 15)
          //label.textColor = .blue
          label.textAlignment = .center
          //label.font = UIFont.systemFont(ofSize: 20)
          label.text = choices[row]
          return label
      }
      func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
          let hourstaken = Double(choices[row])
          print(hourstaken!)
          var stuDent: Student
          if pickerView  == pickerView1 {
              print(choices[row])
              stuDent = Student(hoursTaken: hourstaken!)
              model.student.append(stuDent)
          }
          subView.isHidden = true
          hoursTakenText.text = choices[row]
          print("hello")
      }
      override func viewDidLoad() {
          //pickerViewBack.isHidden = true
          super.viewDidLoad()        
          subView.isHidden = true 
      }
  }
  </code></pre>