<!--
{
  "availability" : [
    "iOS: 17.4.0 -",
    "iPadOS: 17.4.0 -",
    "macCatalyst: 17.4.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Assignables",
  "identifier" : "/documentation/Assignables/AssignedWorkDocumentView/init(document:activePartID:hiddenPartIDs:selectedPageID:selectedQuestionID:showsPageThumbnails:isStructureEditingEnabled:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Assignables"
    ],
    "preciseIdentifier" : "s:11Assignables24AssignedWorkDocumentViewV8document12activePartID06hiddenH3IDs012selectedPageI00l8QuestionI005showsM10Thumbnails25isStructureEditingEnabledAC7SwiftUI7BindingVyAA0bcD0VG_AA023MergeablePartsContainerhI0VSgSayARGAMyAO0M0V0I0VSgGSgAMyAA05Basicd7ElementI0VyAA010AssignableD0V0N0VGSgGSgS2btcfc"
  },
  "title" : "init(document:activePartID:hiddenPartIDs:selectedPageID:selectedQuestionID:showsPageThumbnails:isStructureEditingEnabled:)"
}
-->

# init(document:activePartID:hiddenPartIDs:selectedPageID:selectedQuestionID:showsPageThumbnails:isStructureEditingEnabled:)

Displays an `AssignedWorkDocument`.

```
@MainActor @preconcurrency init(document: Binding<AssignedWorkDocumentView.Document>, activePartID: MergeablePartsContainerPartID? = nil, hiddenPartIDs: [MergeablePartsContainerPartID], selectedPageID: Binding<AssignedWorkDocumentView.Document.Page.ID?>? = nil, selectedQuestionID: Binding<AssignableDocument.Question.ID?>? = nil, showsPageThumbnails: Bool = true, isStructureEditingEnabled: Bool = false)
```

## Parameters

`document`

A binding to the [`AssignedWorkDocumentView.Document`](/documentation/Assignables/AssignedWorkDocumentView/Document) to present in the view.

`activePartID`

The `PartID` to enable user interaction on.

`hiddenPartIDs`

A set of `PartID`s to hide on this view. Treated as a set.

`selectedPageID`

A binding to the selected page.

`selectedQuestionID`

A binding to the selected question.

`showsPageThumbnails`

Controls showing or hiding the document pages thumbnail previews.

`isStructureEditingEnabled`

Controls access to actions that allow changing the structure
of the document on the page thumbnail view contextual menu (i.e. add/duplicate/move/remove pages).

## Discussion

- Example:

```
    AssignedWorkDocumentView(
        document: $document,
        activePartID: activeLayerID,
        hiddenPartIDs: hiddenPartIDs,
        selectedPageID: $selectedPageID,
        showsPageThumbnails: isMultiPageDocument,
        isStructureEditingEnabled: false,
        onMarkupActivation: { isMarkupActivated in
            if isMarkupActivated {
                activeLayerID = AssignedWorkDocument.PartIDs.scorerMarkup
                isMarkupSelected = true
            }
        }
    )
```

---

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)