EKCalendar - Delete calendar iOS13 crash

Hi !

We are using EventKit in our app and we let the user pick which calendar(s) to use to choose their event using EKCalendar Chooser. However, if the user presses on a calendar's edit button ( (i) button ) and decide to delete the calendar, our app crashes. It seems like EKCalendarChooser has an issue presenting an alert. It doesn't happen in iOS14 as the calendar editing button does not exist anymore.

Code Block
Terminating app due to uncaught exception 'NSGenericException', reason: 'Your application has presented a UIAlertController (<UIAlertController: 0x10d1d9a00>) of style UIAlertControllerStyleActionSheet from UINavigationController (<UINavigationController: 0x10da6f400>). The modalPresentationStyle of a UIAlertController with this style is UIModalPresentationPopover. You must provide location information for this popover through the alert controller's popoverPresentationController. You must provide either a sourceView and sourceRect or a barButtonItem. If this information is not known when you present the alert controller, you may provide it in the UIPopoverPresentationControllerDelegate method -prepareForPopoverPresentation.'


We are embeding the view controller in a navigation controller before presenting it.

Code Block
 let vc = EKCalendarChooser(selectionStyle: .multiple, displayStyle: .allCalendars, entityType: .event, eventStore: self.eventManager.eventStore)
vc.selectedCalendars = Set<EKCalendar>()
vc.delegate = self
let nvc = UINavigationController(rootViewController: vc)
self.present(nvc, animated: true, completion: nil)
 


Is there something we can do to prevent the crash from happening?

Thank you !
You don't show the UIAlertController involved in the crash. Nor do you show the code related to other log message objects.

Please provide more complete code.
The UIAlertController is created by EKCalendarChooser from the EventKit framework, so we don't have access to that code. The only code involved in our app for creating the EKCalendarChooser is the one stated above.
In which thread is this executing ? In which thread is the crash ?
May be you should dispatch the present() to main thread.

Where do you run the code you've shown ?
EKCalendar - Delete calendar iOS13 crash
 
 
Q