---
title: "callAsFunction(contentType:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/newdocumentaction/callasfunction(contenttype:)"
---

# callAsFunction(contentType:)

Presents a new document window.

## Declaration

```swift
@MainActor @preconcurrency func callAsFunction(contentType: UTType)
```

## Parameters

- `contentType`: The content type of the document.

## Discussion

Discussion Don’t call this method directly. SwiftUI calls it when you call the newDocument action: newDocument(contentType: .todoList)

extension UTType {      static let todoList = UTType(exportedAs: "com.myApp.todoList")  } important: If your app declares custom uniform type identifiers, include corresponding entries in the app’s Info.plist file. For more information, see Defining file and data types for your app. Also, remember to specify the supported Document types in the Info.plist file as well. For information about how Swift uses the callAsFunction() method to simplify call site syntax, see Methods with Special Names in The Swift Programming Language.

## See Also

### Calling the action

- [callAsFunction(_:)](swiftui/newdocumentaction/callasfunction(_:).md)
- [callAsFunction(contentType:prepareDocument:)](swiftui/newdocumentaction/callasfunction(contenttype:preparedocument:).md)
