Contents

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

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

Declaration

nonisolated init(_ title: LocalizedStringKey, for contentTypes: [UTType], @ContentBuilder _ actions: () -> Actions, @ContentBuilder onDocumentOpen: @escaping (URL) -> DocumentView, @ContentBuilder background: () -> some View, @ContentBuilder backgroundAccessoryView: @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.

  • background:

    A background of the view.

  • backgroundAccessoryView:

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

Discussion