title: UiPickerview values displayed as question mark ("?")in swift - But getting the correct value while assigning it to a textBox
body: <p>//I am able to see the correct value in the text box upon scrolling down the picker view. But the picker view display is coming as "?" (question marks). I am confused with where I need to assign the pickerview as input view to the textbox . But still that won't make any sense to the error I am facing right . </p>
  
  <p>I am using Xcode 9 and Swift 3.2.</p>
  
  <pre><code>class BillDetailsViewController: UIViewController ,UITextFieldDelegate,UIPickerViewDelegate,UIPickerViewDataSource{
  
    //Variables  Declaration
  
    //Picker view outlet
    @IBOutlet var datePickerView: UIPickerView!
  
    //Picker view datasource - integer array
    var integerArray = [Int](1899...2500)
  
    //Textbox where picked value to be shown
    @IBOutlet var txtPaidYear: UITextField!
  
    //ViewLoad
    override func viewDidLoad() {
  
      super.viewDidLoad()
      self.hideKeyboardWhenTappedAround()
  
      datePickerView.isHidden = true
      datePickerView.reloadAllComponents()
      datePickerView.dataSource = self
      datePickerView.delegate = self
      txtPaidYear.inputView = datePickerView
    }
  
    //picker view delegate functions
  
    public func numberOfComponents(in pickerView: UIPickerView) -&gt; Int {
      return 1
    }
  
    public func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -&gt; Int {
      return integerArray.count
    }
  
    public func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -&gt; String! {
      let pickerValue: String = String(integerArray[row])
      return pickerValue
    }
  
    public func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
      txtPaidYear.text = String(integerArray[row])
      self.datePickerView.reloadAllComponents()
    }
  }
  </code></pre>