Contents

revealDocument(at:importIfNeeded:completion:)

Reveals, and optionally imports, the document at the provided URL.

Declaration

func revealDocument(at url: URL, importIfNeeded: Bool, completion: ((URL?, (any Error)?) -> Void)? = nil)
func revealDocument(at url: URL, importIfNeeded: Bool) async throws -> URL

Parameters

  • url:

    The URL of the document to reveal.

  • importIfNeeded:

    A Boolean value that determines whether the document browser should import the document.

  • completion:

    A completion block with the following parameters:

    url

    The new URL of an imported document. Set to nil if shouldImport is False, or if an error occurs.

    error

    If an error occurs, this parameter contains the error information; otherwise, set to nil.

Mentioned in

Discussion

Call this method to display a document in the document browser.

If importIfNeeded is true, the document browser calls its delegate’s documentBrowser(_:didImportDocumentAt:toDestinationURL:) method (or its documentBrowser(_:failedToImportDocumentAt:error:) method, if an error occurred) before calling the completion handler.

See Also

Configuring a document browser