---
title: "init(documentURL:willSubmit:didSubmit:willWithdraw:didWithdraw:)"
framework: ClassKit UI
role: symbol
role_heading: Initializer
platforms: [macOS 26.4+]
path: "classkitui/assigneddocumentmenuitem/init(documenturl:willsubmit:didsubmit:willwithdraw:didwithdraw:)"
---

# init(documentURL:willSubmit:didSubmit:willWithdraw:didWithdraw:)

Creates a menu item for assigned document submission.

## Declaration

```swift
init(documentURL: URL, willSubmit: @escaping @Sendable (URL) async -> Bool = { _ in true }, didSubmit: @escaping (URL) -> Void = { _ in }, willWithdraw: @escaping @Sendable (URL) async -> Bool = { _ in true }, didWithdraw: @escaping (URL) -> Void = { _ in })
```

## Parameters

- `documentURL`: The URL of the assigned document.
- `willSubmit`: A closure that executes before submission. Return false to prevent submission.
- `didSubmit`: A closure that executes after successful submission.
- `willWithdraw`: A closure that executes before withdrawing. Return false to prevent withdrawal.
- `didWithdraw`: A closure that executes after successful withdrawal.
