I want the user to be able to chose a new default calendar with the EKCalendarChooser. So far this is what I thought that might work but it is not.
func calendarChooserDidFinish(_ calendarChooser: EKCalendarChooser) {
print("Done was pressed")
// Set to default calendar
eventStore.defaultCalendarForNewReminders()
for source in eventStore.sources {
if source.sourceType == .local {
calendar.source = source
break
}
}
dismiss(animated: true, completion: nil)
}
How can I set a new default calendar with the EKCalendarChooser?