---
title: "createDocumentAction(withIntent:)"
framework: uikit
role: symbol
role_heading: Type Method
path: "uikit/uidocumentviewcontroller/launchoptions-swift.class/createdocumentaction(withintent:)"
---

# createDocumentAction(withIntent:)

Creates an action that uses the specified intent.

## Declaration

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

## Parameters

- `intent`: An intent that defines how your app creates the document.

## Mentioned in

Customizing a document-based app’s launch experience

## Discussion

Discussion Use this method to create an action that you can assign to your primaryAction or secondaryAction. When the system triggers the action, it calls your UIDocumentBrowserViewControllerDelegate object’s documentBrowser(_:didRequestDocumentCreationWithHandler:) method. For more information, see Customizing a document-based app’s launch experience.
