Contents

init(_:for:_:onDocumentOpen:overlayAccessoryView:)

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

Declaration

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

Parameters

  • title:

    A title key to use for the view title.

  • contentTypes:

    Content types that the view can open.

  • actions:

    A content builder returning the view’s actions

  • onDocumentOpen:

    A closure that handles an open file.

  • overlayAccessoryView:

    A content builder for returning the view’s overlay accessory view.

Discussion