<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWorkspace/willUnmountNotification",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:@NSWorkspaceWillUnmountNotification"
  },
  "title" : "willUnmountNotification"
}
-->

# willUnmountNotification

A notification that the workspace posts when the Finder is about to unmount a device.

```
class let willUnmountNotification: NSNotification.Name
```

## Discussion

This notification doesn’t post if a volume becomes forcibly and immediately unavailable, such as when simply unplugging a drive.

The notification object is the shared `NSWorkspace` instance. The `userInfo` dictionary contains a key `@"NSDevicePath"` that returns the path where the device mounts as a string.

> Important:
> To receive this notification, use ``doc://com.apple.appkit/documentation/AppKit/NSWorkspace/notificationCenter`` to register for it. If you use a different notification center to register, you won’t receive the notification.

To observe this notification using Swift concurrency, use [`NSWorkspace.WillUnmountVolumeMessage`](/documentation/AppKit/NSWorkspace/WillUnmountVolumeMessage).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)