Instance Method

startProvidingItem(at:completionHandler:)

Provides an actual file on disk for a placeholder.

Declaration

func startProvidingItem(at url: URL, completionHandler: @escaping (Error?) -> Void)

Parameters

url

The URL of a shared document.

completionHandler

A block to be called as soon as the file is available.

The completion handler takes the following parameter:

error

If the document was produced, this value is nil. Otherwise, it holds an NSError object describing the error.

Discussion

This method is called whenever another process tries to access a placeholder for a shared document.

Override this method to download, create, or otherwise provide the file. As soon as the file is available, call the provided completion handler. If any errors occur during this process, pass the error to the completion handler. The system then passes the error back to the original coordinated read or write.

You must override this method. Do not call super in your implementations.

See Also

Managing Shared Files

func itemChanged(at: URL)

Tells the File Provider extension that a document has changed.

Deprecated
func providePlaceholder(at: URL, completionHandler: (Error?) -> Void)

Triggers the creation of a placeholder for the given URL.

Deprecated
func stopProvidingItem(at: URL)

Tells the File Provider extension that a given document is no longer being accessed.

Deprecated