<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIDocumentViewController/LaunchOptions-swift.class/createDocumentAction(withIntent:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIDocumentViewControllerLaunchOptions(cm)createDocumentActionWithIntent:"
  },
  "title" : "createDocumentAction(withIntent:)"
}
-->

# createDocumentAction(withIntent:)

Creates an action that uses the specified intent.

```
class func createDocumentAction(withIntent intent: UIDocument.CreationIntent) -> UIAction
```

## Parameters

`intent`

An intent that defines how your app creates the document.

## Discussion

Use this method to create an action that you can assign to your [`primaryAction`](/documentation/UIKit/UIDocumentViewController/LaunchOptions-swift.class/primaryAction) or [`secondaryAction`](/documentation/UIKit/UIDocumentViewController/LaunchOptions-swift.class/secondaryAction). When the system triggers the action, it calls your [`UIDocumentBrowserViewControllerDelegate`](/documentation/UIKit/UIDocumentBrowserViewControllerDelegate) object’s [`documentBrowser(_:didRequestDocumentCreationWithHandler:)`](/documentation/UIKit/UIDocumentBrowserViewControllerDelegate/documentBrowser(_:didRequestDocumentCreationWithHandler:)) method. For more information, see [Customizing a document-based app’s launch experience](/documentation/UIKit/customizing-a-document-based-app-s-launch-experience).

---

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)