title: Add a Done button within a pop-up datePickerView in Swift?
body: <p>I want to add a Done button within a popped up datePickerView in Swift.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>@IBOutlet var datePicker: UITextField!
  
  @IBAction func dateTextInputPressed(sender: UITextField) {
  
      var datePickerView = UIDatePicker()
      datePickerView.datePickerMode = UIDatePickerMode.Date
  
      sender.inputView = datePickerView
      datePickerView.addTarget(self, action: Selector("handleDatePicker:"), forControlEvents: UIControlEvents.ValueChanged)
  }
  
  func handleDatePicker(sender: UIDatePicker) {
      var dateFormatter = NSDateFormatter()
      dateFormatter.dateFormat = "yyyy-MM-dd"
      datePicker.text = dateFormatter.stringFromDate(sender.date)
  }
  </code></pre>
  
  <p>I can use this code to pop up a datePickerView successfully.</p>
  
  <p><img src="https://i.stack.imgur.com/yEHsc.png" alt="result of datePickerView"></p>
  
  <p>But after I've selected the date, it does not have a "Done" button to dismiss it.</p>
  
  <p>So how can I add the Done button into it?</p>