---
title: NSUserActivityDocumentURLKey
framework: appkit
role: symbol
role_heading: Global Variable
path: appkit/nsuseractivitydocumenturlkey
---

# NSUserActivityDocumentURLKey

The key that identifies the document associated with a user activity.

## Declaration

```swift
let NSUserActivityDocumentURLKey: String
```

## Discussion

Discussion You use this key in the userInfo dictionary of an NSUserActivity object. Its value is the URL of the document associated with the user activity. When the NSUbiquitousDocumentUserActivityType key is present in a CFBundleDocumentTypes entry, AppKit automatically creates an NSUserActivity object for documents in iCloud, using the given activity type.

## See Also

### Supporting User Activities

- [userActivity](appkit/nsdocument/useractivity.md)
- [updateUserActivityState(_:)](appkit/nsdocument/updateuseractivitystate(_:).md)
