title: Two textfield with same date picker
body: <p>I have two textfields that I want to input times into.
  I've gotten one of the textfields to work so that the inputView is a date picker, however, I can't figure out if there's an easy way to change my code so that the other text field would also have a date picker as the input field.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>func createDatePicker(){
      let toolbar = UIToolbar()
      toolbar.sizeToFit()
  
      //done button
      let done = UIBarButtonItem(barButtonSystemItem:.done, target: nil, action: #selector(donePressed))
      toolbar.setItems([done], animated: false)
  
      fromTextField.inputAccessoryView = toolbar
      fromTextField.inputView = picker
  
  
      picker.datePickerMode = .time
      picker.minuteInterval = 15
  
  }
  @objc func donePressed(){
      let formatter = DateFormatter()
      formatter.dateStyle = .none
      formatter.timeStyle = .short
      let dateString = formatter.string(from: picker.date)
  
      fromTextField.text = "\(dateString)"
      self.view.endEditing(true)
  
  }
  </code></pre>
  
  <p>What would be the best way to make this code work for a toTextField too besides just making a copy of these two functions?</p>