---
title: "init(viewing:migrationPlan:viewer:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/documentgroup/init(viewing:migrationplan:viewer:)"
---

# init(viewing:migrationPlan:viewer:)

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

## Declaration

```swift
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.

## See Also

### Viewing a document backed by a persistent store

- [init(viewing:contentType:viewer:)](swiftui/documentgroup/init(viewing:contenttype:viewer:).md)
