<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macOS: 14.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/DocumentGroup/init(viewing:migrationPlan:viewer:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI13DocumentGroupV01_a5Data_aB0AD05ModelC0VRszrlE7viewing13migrationPlan6viewerACyAFq_G22UniformTypeIdentifiers6UTTypeV_0aE0015SchemaMigrationI0_pXpq_yctcfc"
  },
  "title" : "init(viewing:migrationPlan:viewer:)"
}
-->

# init(viewing:migrationPlan:viewer:)

Instantiates a document group for viewing documents
described by the last `Schema` in the migration plan.

```
nonisolated init(viewing contentType: UTType, migrationPlan: any SchemaMigrationPlan.Type, viewer: @escaping () -> Content)
```

## Parameters

`viewing`

The content type of the document. It should conform to `UTType.package`.

`migrationPlan`

The description of steps required to migrate older document
versions so that they can be opened.
The last `VersionedSchema` in the plan is considered to be
the current application schema.

`viewer`

The viewing UI for the provided document.

---

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)