Open raginggoat opened 5 years ago
@raginggoat
Check the issue #99, Yes didSelect
event do not be invoked when by calling selectDate
method.
The simple way to call the didSelect
function after call selectDate
method, Like this:
@objc func dismissKeyboard() {
for date in self.calendarView.selectedDates {
self.calendarView.deselect(date)
}
let dateFormatter = DateFormatter()
dateFormatter.dateStyle = .medium
dateFormatter.timeStyle = .none
let startDate = dateFormatter.date(from: self.startDateField.text!)
if startDate != nil {
self.enteredStartDate = startDate
self.calendarView.select(startDate, scrollToDate: false)
//Call after select method.
self.calendar(self.calendar, didSelect: startDate, at: .current)
}
self.startDateField.resignFirstResponder()
}
I am able to select dates just fine when tapping on a date. My issue is happening when using a date picker to select a date. It selects the date on the calendar but the didSelect method doesn't get called.