Instance Method インスタンスメソッド

quickLookPreview(_:in:)

Presents a Quick Look preview of the given URLs.

Declaration 宣言

func quickLookPreview<Items>(_ selection: Binding<Items.Element?>, in items: Items) -> some View where Items : RandomAccessCollection, Items.Element == URL

Parameters パラメータ

selection

A Binding to an element that is part of the items collection. This is the URL that should be currently previewed.

items

A collection of URLs to preview.

Discussion 議論

Quick Look will not appear until a non-nil selection is set. When selection is set back to nil, the preview is dismissed. If the value of the selection binding is not contained in the items collection, it is treated the same as a nil selection.

The value of the selection binding is updated by Quick Look to match the URL of the file the user is previewing.

Upon dismissal, Quick Look automatically sets the selection binding to nil.

See Also 参照

Quick Look Previews