How do you add an event to the user's calendar, but then allow the user to choose the calendar, etc. I have this code that works, but this adds the event to the user's default calendar. How do I allow the user to change the calendar, customize the alerts etc? I have seen other apps open the calendar app and pre-fill the fields.
//add to calendar
let eventStore : EKEventStore = EKEventStore()
eventStore.requestAccessToEntityType(EKEntityType.Event, completion: { (granted, error) in
if granted && error == nil {
let event:EKEvent = EKEvent(eventStore: eventStore)
event.title = "My event: " + self.event.name
event.startDate = self.event.startTime
event.endDate = self.event.endTime
event.notes = self.event.description
event.calendar = eventStore.defaultCalendarForNewEvents
do {
try eventStore.saveEvent(event, span: .ThisEvent, commit: true)
self.dismissViewControllerAnimated(true, completion: {})
} catch {
self.dismissViewControllerAnimated(true, completion: {})
}
} else {
self.dismissViewControllerAnimated(true, completion: {})
}
})