title: [swift5][ios] How can I open DatePicker by a button Click?
body: <p>I want to make such that if I click a button, it should show DatePicker
  If I select day from DatePicker, display label or textfield
  How can I hide or no create DatePicker on storyboard</p>
  <p>I have been searching many times and find many example code
  but those example code display datepicker initially
  sorry, my english so bad, I`m korean</p>
  <p><a href="https://i.stack.imgur.com/nVMO7.png" rel="nofollow noreferrer">enter image description here</a></p>
  <pre><code>     @IBAction func changeDatePicker(_ sender: UIDatePicker) {
       }
  
  
  
   }
   extension UITextField{
       func setDatePicker(target: Any, selector: Selector){
           let SCwidth = self.bounds.width
           let datePicker = UIDatePicker(frame: CGRect(x: 0, y:0, width: 
           SCwidth, height: 216))
           datePicker.datePickerMode = .date
           //self.inputView = datePicker
      
           let toolBar = UIToolbar(frame: CGRect(x:0.0, y: 0.0, width: SCwidth, 
           height: 44.0))
           let flexible = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, 
           target: nil, action:nil)
           let cancel = UIBarButtonItem(title: &quot;Cancel&quot;, style: .plain, 
           target:nil, action: #selector(tapCancel))
      
           let barButton = UIBarButtonItem(title: &quot;Done&quot;, style: .plain, 
           target: 
           target, action: selector)
           toolBar.setItems([cancel, flexible, barButton], animated: false)
           //self.inputAccessoryView = toolBar
       }
       @objc func tapCancel(){
           self.resignFirstResponder()
       }
  }
  </code></pre>