Instance Method

revealDocument(at:importIfNeeded:completion:)

Reveals (and optionally imports) the document at the provided URL.

Declaration

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

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.

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

var allowedContentTypes: [String]

The document types that the browser can open.

var allowsDocumentCreation: Bool

A Boolean value that determines whether the document browser can create new documents.

var allowsPickingMultipleItems: Bool

A Boolean value that determines whether the user can select and open more than one document at a time.