Type Method

writePlaceholderAtURL:withMetadata:error:

Writes a document placeholder with the provided metadata.

Declaration

+ (BOOL)writePlaceholderAtURL:(NSURL *)placeholderURL withMetadata:(NSDictionary<NSURLResourceKey, id> *)metadata error:(NSError * _Nullable *)error;

Parameters

placeholderURL

The placeholder URL for the document. You can generate a placeholder URL from a document URL by calling placeholderURLForURL:.

metadata

The metadata for this document.

error

If an error occurs while writing the placeholder, the error parameter is set to an NSError object that describes the problem. If you are not interested in the error details, you may pass in NULL.

Return Value

YES, if the placeholder is written successfully; otherwise NO.

Discussion

Call this method whenever you need to create a placeholder for a document. The metadata that you provide depends largely on the needs of your document picker’s user interface; however, the common options include file size, filename, and thumbnails.

You must not override this method.

See Also

Managing Placeholders

+ placeholderURLForURL:

Returns a placeholder URL for a given document URL.

Deprecated