<!--
{
  "availability" : [
    "iOS: 26.4.0 -",
    "iPadOS: 26.4.0 -",
    "macCatalyst: 26.4.0 -",
    "macOS: 26.4.0 -",
    "visionOS: 26.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ClassKit",
  "identifier" : "/documentation/ClassKit/CLSDataStore/checkIsAssignedDocument(_:completion:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ClassKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CLSDataStore(im)checkIsAssignedDocument:completion:"
  },
  "title" : "checkIsAssignedDocument(_:completion:)"
}
-->

# checkIsAssignedDocument(_:completion:)

```
func checkIsAssignedDocument(_ documentURL: URL, completion: @escaping @Sendable (Bool, (any Error)?) -> Void)
```

```
func isAssignedDocument(_ documentURL: URL) async throws -> Bool
```

## Parameters

`documentURL`

The file URL of the document to check.

`completion`

A block called when the check is complete. The block takes two parameters:

- isAssignedDocument: A Boolean indicating whether the document is assigned to the current user.
- error: An error object if the check failed, or nil if successful.

## Discussion\abstract Determines whether a URL to the document was assigned to the student.
\discussion This method checks if the document at the specified URL is assigned to the current student
signed into the device.

```
           This is particularly useful for implementing student-specific workflows, such as:
           - Showing submission UI only for assigned documents
           - Displaying assignment-specific metadata or instructions
           - Enabling special features or restrictions for assigned work

           The completion handler's `isAssignedDocument` parameter will be `YES` when:
           - The document URL corresponds to an active assigned document
           - The current user is authenticated as a student and assigned to this specific document

           The completion handler's `isAssignedDocument` parameter will be `NO` when:
           - The document is not part of any assigned document
           - The current user is not a student (e.g., teacher)
           - The document has been unassigned or deleted
           - The student does not have permission to access this assignment
```

\note This method is designed to be called from ClassKitUI clients and requires proper ClassKit entitlements.
The completion handler may be called on a background thread, so dispatch to the main queue if you need
to update UI based on the result.

[[CLSDataStore shared] checkIsAssignedDocument:documentURL completion:^(BOOL isAssignedDocument, NSError * _Nullable error) {
dispatch_async(dispatch_get_main_queue(), ^{
if (error) {
NSLog(@“Error checking assignment status: %@”, error);
return;
}

```
    if (isAssignedDocument) {
        // Show UI with submission options
        [self showAssignedDocumentSubmissionUI];
    } else {
        // Show standard document UI
        [self showStandardDocumentUI];
    }
});
```

}];

---

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)