I now develop an iOS App that shows a list of iCloud EKCalendars. My swift codes can get a set of iCloud EKCalendars, but the order is always different. Could anyone give me advice to get the set in order?
let eventStore = EKEventStore()
let sources = eventStore.sources
for source in sources {
if (source.title == "iCloud") {
let calendars = source.calendars(for: .event)
for calendar in calendars {
print("calendar title = " + calendar.title)
}
}
}
Example of the result of the codes:
calendar title = title1
calendar title = title6
calendar title = title5
calendar title = title3
calendar title = title4
calendar title = title2