Open
Description
Hi,
I have 5 years dates in calendar, it's taking very long time to load calendar view.
I i am using below function to load 5 years dates.
let avlblDates = datesRange(from: 01.01.2019, to: Date())
calendarView.setAvailableDates(DaysAvailability.some(avlblDates))
private func datesRange(from: Date, to: Date) -> [Date] {
if from > to { return Date }
var tempDate = from
var array = [tempDate]
while tempDate < to {
tempDate = Calendar.current.date(byAdding: .day, value: 1, to: tempDate)!
array.append(tempDate)
}
return array
}
Please help me on this as it takes upto 10 seconds to load calendar view.
Thanks.
Metadata
Metadata
Assignees
Labels
No labels