In theory, yes. However I haven't been able to get it working yet in iOS 13 Beta 4.
Take a look at the ImageCaptureCore framework. In particular, ImageCaptureCore/ICDeviceBrowser.h. You would:
- Initialize the browser.
- Set the delegate.
- Start the browser.
- Your delegate should then receive "deviceBrowser:(ICDeviceBrowser*)browser didAddDevice:(ICDevice*)addedDevice" notifications.
#import <ImageCaptureCore/ImageCaptureCore.h> ... id deviceBrowser = [[ICDeviceBrowser alloc] init]; deviceBrowser.delegate = self; [deviceBrowser start];
You should then receive notifications that a device was added. However, I have not been able to get this working in iOS 13 Beta 4. No notifications are received and the browser's "devices" property always returns an empty array.
Hopefully this will be working in futre releases.
Thanks for the answer. It still doesnt work in beta 8. The delegate is never called. I suspect that disk device insertion notification is related to the functionality offered by the Disk Arbitration Framework which exists in MacOS. Currently that framework doesnt exist in iOS/iPadOS
The code below is for macOS, iOS should be the same. I'm using this to detect a camera being plugged into a Mac.
mDeviceBrowser = [[ICDeviceBrowser alloc] init]; mDeviceBrowser.delegate = self; mDeviceBrowser.browsedDeviceTypeMask = ICDeviceLocationTypeMaskLocal|ICDeviceLocationTypeMaskRemote|ICDeviceLocationTypeMaskShared|ICDeviceLocationTypeMaskBluetooth|ICDeviceTypeMaskCamera; // ICDeviceLocationTypeMaskLocal = 0x00000100, // ICDeviceLocationTypeMaskShared = 0x00000200, // ICDeviceLocationTypeMaskBonjour = 0x00000400, // ICDeviceLocationTypeMaskBluetooth = 0x00000800, // ICDeviceLocationTypeMaskRemote = 0x0000FE00 [mDeviceBrowser start];
To see all of this in full flight, take a look at the mac sample app for this called CameraBrowser.
I found two sample apps...
Hope that helps.
In the past, the ability to communicate with a card reader has gone away during betas, at least with iOS 10, 11 and 12, so it's not surprising to see history repeat itself. Might need to wait until later in the beta cycle, or for iOS 13 release version.