PHPickerViewControllerDelegate didCancel

Hello. In my app I have selection of photos and videos and also selection of PDF So I use PHPickerViewController for picking photos and videos and UIDocumentPickerViewController for picking documents.

I found out that there's not documentPickerWasCancelled in PHPickerViewController delegate. So when a user presses Cancel, delegate's picker function fires the dialog is dismissed and system return a selected value of nil. But when I swipe the dialog down no event is generated so in my app I can't understand whether a user selected a photo or cancelled the dialog. In UIDocumentPickerViewController there's no such problems as it have didCancel as a separate funciton Is there any way to bypass this this?

Answered by DTS Engineer in 807474022

Hello @deryni,

You can set the picker.presentationController.delegate to detect when a presentation is dismissed.

Best regards,

Greg

Accepted Answer

Hello @deryni,

You can set the picker.presentationController.delegate to detect when a presentation is dismissed.

Best regards,

Greg

PHPickerViewControllerDelegate didCancel
 
 
Q