init(document:activePartID:hiddenPartIDs:selectedPageID:selectedQuestionID:showsPageThumbnails:isStructureEditingEnabled:)
Displays an AssignableDocument.
Declaration
@MainActor @preconcurrency init(document: Binding<AssignableDocumentView.Document>, activePartID: MergeablePartsContainerPartID? = nil, hiddenPartIDs: [MergeablePartsContainerPartID] = [], selectedPageID: Binding<AssignableDocumentView.Document.Page.ID?>? = nil, selectedQuestionID: Binding<AssignableDocumentView.Document.Question.ID?>? = nil, showsPageThumbnails: Bool = true, isStructureEditingEnabled: Bool = true)Parameters
- document:
A binding to the Document to present in the view.
- activePartID:
The
PartIDto enable user interaction on. - hiddenPartIDs:
A set of
PartIDs to hide on this view. Treated as a set. - selectedPageID:
A binding to the selected page id.
- selectedQuestionID:
A binding to the selected question id.
- 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:
AssignableDocumentView(
document: $document,
activePartID: activeLayerID,
hiddenPartIDs: hiddenPartIDs,
selectedPageID: $selectedPageID,
showsPageThumbnails: isMultiPageDocument,
isStructureEditingEnabled: false,
onMarkupActivation: { isMarkupActivated in
if isMarkupActivated {
activeLayerID = AssignableDocument.PartIDs.instructionMarkup
isMarkupSelected = true
}
}
)