Detect drive attachment on iPadOS

I have been able to develop an application for iPadOS that allows someone to select a folder from an external drive using UIDocumentPickerViewController. I can then get access to the folder selected by the user and read and modify its contents whenever necessary by saving off an application based secured bookmark. The application can function without the drive attached and having access to that bookmarked folder. However, if the drive was unattached and my application was running, I would like to have the ability to detect when that drive was reattached so that the application could perform any needed operations related to that folder.

On macOS someone can potentially effect this kind of functionality by accessing the notification center for NSWorkspace and registering for the NSWorkspaceDidMountNotification to know that a device has been mounted. Then they can check to see if that is the desired device they want to monitor.

I’m wondering how someone could possibly effect this same kind of behavior for iPadOS.

Detect drive attachment on iPadOS
 
 
Q