title: UIDatePicker in UITextField in UITableView with custom UITableViewCell: realtime update
body: <p>I have the exact same scenario as in this question:</p>
  
  <p><a href="https://stackoverflow.com/questions/6208118/uidatepicker-in-uitextfield-in-uitableview-realtime-update">UIDatePicker in UITextField in UITableView realtime update</a></p>
  
  <p>In summary: I have a textfield in a custom cell which calls a UIDatePicker. I want the textfield to update whenever the datepicker is modified, and I want it to store the last value when the "Done" button (located inside the toolbar created for the datepicker) is tapped.</p>
  
  <p>I can get the value selected in the pickerview (I actually print it to the console), but I'm not able to put that value in the textfield.</p>
  
  <p>However, I need to do it in swift, and I'm not able to. I've been trying to use action: #selector() but since it doesn't accept more than 1 parameter in the function inside the selector, it's not helping me.</p>
  
  <p>Custom Table View Cell:</p>
  
  <pre><code>class employeesTableViewCell : UITableViewCell {
     @IBOutlet weak var employeeNumberField: UILabel!
     @IBOutlet weak var employeeNameField: UITextField!
     @IBOutlet weak var employeeSurnameField: UITextField!
     @IBOutlet weak var employeeIDField: UITextField!
     @IBOutlet weak var employeeBirthDateTxtFieldOutlet: UITextField!
  }
  </code></pre>
  
  <p>In ViewController (the tag strategy shown below is being used for capturing the field edited through textFieldShouldReturn):</p>
  
  <pre><code>func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
      let cell = tableView.dequeueReusableCell(withIdentifier: "employeeCell") as! employeesTableViewCell!
  
      createPickerView(sender:  (cell?.employeeBirthDateTxtFieldOutlet)!)
      createToolbar(sender:  (cell?.employeeBirthDateTxtFieldOutlet)!)
  
      cell?.employeeNameField.tag = indexPath.row * 10 + 1
      cell?.employeeSurnameField.tag = indexPath.row * 10 + 2
      cell?.employeeIDDocField.tag = indexPath.row * 10 + 3
      cell?.employeeBirthDateTxtFieldOutlet.tag = indexPath.row * 10 + 5
      cell?.employeeNumberField.text = "Employee \(indexPath.row + 1)"
  
      return cell!
  }
  
  func createPickerView(sender: UITextField){
      let datePickerView : UIDatePicker = UIDatePicker()
  
      datePickerView.datePickerMode = UIDatePickerMode.date
      sender.inputView = datePickerView
      datePickerView.tag = sender.tag
      datePickerView.addTarget(self, action: #selector(datePickerValueChanged(caller:destination:)), for: UIControlEvents.valueChanged)
  }
  
  @objc func datePickerValueChanged(caller: UIDatePicker, destination: UITextField){
      let dateFormatter = DateFormatter()
      dateFormatter.dateStyle = DateFormatter.Style.medium
      dateFormatter.timeStyle = DateFormatter.Style.none
  
      destination.text = dateFormatter.string(from: caller.date)  &lt;-- I expected I could update the text here, as I'm referencing it through the parameter, but it doesn't work. However, no error is raised.
  }
  
  
  
  func createToolbar(sender: UITextField){
      let datePickerToolbar = UIToolbar()
      datePickerToolbar.sizeToFit()
  
      let doneButton = UIBarButtonItem(title: "Done", style: .plain, target: self, action: #selector(employeeRegisterController.dismissKeyboard))
      doneButton.tag = sender.tag
  
      datePickerToolbar.setItems([doneButton], animated: false)
      datePickerToolbar.isUserInteractionEnabled = true
  
      sender.inputAccessoryView = datePickerToolbar
  }
  
  @objc func dismissKeyboard(on: UIButton){
      view.endEditing(true)
  }
  </code></pre>