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 -> URLParameters
- 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
nilifshouldImportis 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.