Home > Back-end >  UIDatePicker UIDatePickerStyle = .compact notification when pop-up calendar is dismissed
UIDatePicker UIDatePickerStyle = .compact notification when pop-up calendar is dismissed

Time:03-07

I would like to receive a notification when the user dismisses the pop-up calendar for a .compact style UIDatePicker. The user may trigger several valueChanged while trying to select the right date, so I would like to get notified when the user taps outside the calendar to dismiss it.

CodePudding user response:

You can try to observe editingDidEnd control event:

yourDatePicker.addTarget(self, action: #selector(yourCallback), for: .editingDidEnd)
  • Related