no didCancel in PHPickerViewControllerDelegate?

There's only a single function under PHPickerViewControllerDelegate which is didFinishPicking according to the documentation. How do I implement dismiss for the Cancel button that comes along when tapping out with PHPickerViewController?

Have no problem if continue using UIImagePickerControllerDelegate, as it comes with imagePickerControllerDidCancel . However, if I were to implement with the new PHPickerViewController that currently only have a single function, how to enable proper dismiss right on the click of Cancel button instead of just relying the swipe down to dismiss the screen. Kindly advise. Thanks.

Hello,

picker(_:didFinishPicking:) is also called when the cancel button is pressed, and in this case the results array will be empty. So, if you get an empty results array, you can dismiss the picker.

I found a similar issue, where the cancel button is triggering picker(didFinishPicking) and everything works fine. But when I swipe down the PHPickerViewController, If is not triggering the picker method. How can I know if the user closed the Picker view controller by swiping down?

no didCancel in PHPickerViewControllerDelegate?
 
 
Q