Contents

init(_:for:_:onDocumentOpen:background:)

Creates a view to present when launching document-related user experiences using a localized title, custom actions, and a background view.

Declaration

init(_ title: LocalizedStringKey, for contentTypes: [UTType], @ViewBuilder _ actions: () -> Actions, @ViewBuilder onDocumentOpen: @escaping (URL) -> DocumentView, @ViewBuilder background: () -> some View)

Parameters

  • title:

    A title key to use for the view title.

  • contentTypes:

    Content types that the view can open.

  • actions:

    A view builder returning the view’s actions

  • onDocumentOpen:

    A closure that handles an open file.

  • background:

    A background of the view.

Discussion