2

It's fairly easy on macOS to detect mount and unmount operations with an NSNotificationCenter listener, as explained here.

But I'm actually looking for a way to detect whether a (physical or virtual) storage device was attached (without mount) or detached (e.g. after unmount).

(It must be possible because there are a couple of applications like Jettison or Mountain that have this functionality, e.g. they will notice when the external storage device is detached, or whether it's still present for re-mounting.)

JayB
  • 533
  • 4
  • 10
  • Does this answer your question? [USB Connection Delegate on Swift](https://stackoverflow.com/questions/39003986/usb-connection-delegate-on-swift) – Willeke Feb 09 '21 at 12:31
  • DiskArbitration framework? https://developer.apple.com/documentation/diskarbitration/1492707-daregisterdiskappearedcallback – sbooth Feb 09 '21 at 15:27

0 Answers0