<!--
{
  "availability" : [
    "iOS: 26.4.0 -",
    "iPadOS: 26.4.0 -",
    "macCatalyst: 26.4.0 -",
    "visionOS: 26.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ClassKitUI",
  "identifier" : "/documentation/ClassKitUI/AssignedDocumentDeferredMenuElement",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "ClassKit UI"
    ],
    "preciseIdentifier" : "c:@M@ClassKitUI@objc(cs)AssignedDocumentDeferredMenuElement"
  },
  "title" : "AssignedDocumentDeferredMenuElement"
}
-->

# AssignedDocumentDeferredMenuElement

A deferred menu element that provides assigned document submission functionality.

```
@MainActor @objc @preconcurrency class AssignedDocumentDeferredMenuElement
```

## Overview

`AssignedDocumentDeferredMenuElement` enables students to submit and withdraw assigned
documents directly from UIKit menus. The menu element loads asynchronously, fetching document
metadata from ClassKit and displaying the appropriate action based on the current submission status.
The element shows an in-line spinner during both initial loading and submission processing.

The following example shows how to create an assigned document menu item
and customize its behavior with validation and completion actions:

```swift
// Create a basic assigned document submission menu element
let menuElement = AssignedDocumentDeferredMenuElement(documentURL: documentURL)
menu.children = [menuElement]

// Create menu item with validation and logging
let menuElement = AssignedDocumentDeferredMenuElement(
    documentURL: documentURL,
    willSubmit: { url in
        // Validate the assigned document before submission
        guard await validateDocument(url) else {
            await showAlert("Please complete all sections before submitting")
            return false // Prevents submission
        }
        return true // Allows submission to continue
    },
    didSubmit: { url in
        // Handle successful submission
        logEvent("Assigned document submitted successfully!")
    }
)
// Add the configured item to the menu
menu.addItem(menuItem)
```

## Topics

### Initializers

[`convenience init(documentURL: URL, willSubmit: (URL) async -> Bool, didSubmit: (URL) -> Void, willWithdraw: (URL) async -> Bool, didWithdraw: (URL) -> Void)`](/documentation/ClassKitUI/AssignedDocumentDeferredMenuElement/init(documentURL:willSubmit:didSubmit:willWithdraw:didWithdraw:))

Creates a deferred menu element for assigned document submissions.

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`UIAccessibilityIdentification`](/documentation/UIKit/UIAccessibilityIdentification)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

### Inherits From

[`UIDeferredMenuElement`](/documentation/UIKit/UIDeferredMenuElement)

---

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)