1

I want to have a hidden datepicker and trigger a tap event on that UIControl when I tap another UIView.

@objc func editDateTime() {
    self.datePicker.sendActions(for: .touchUpInside)
}

Whether datepicker is hidden or not, I am not seeing date picker opening up. Basically I am trying to show a custom UI instead of the standard rendering of date picker.

rysv
  • 2,416
  • 7
  • 30
  • 48

1 Answers1

2

I'm guessing you want the "popup calendar" feature?

If so, you can overlay a button (or label, or view, or whatever) on the Compact Date Picker, and allow a tap to pass-through to the trigger the calendar popup.

DonMag
  • 69,424
  • 5
  • 50
  • 86
  • Thanks. Just that with iOS 13 or 14 there are new formats and behave differently (inline, compact, etc.) Need the overlay to cover what is applicable. May be cumbersome but will be a good workaround. – rysv Mar 06 '21 at 22:28