Instance Method

registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:

Registers a file-backed representation for an item, specifying file options, item visibility, and a load handler.

Declaration

- (void)registerFileRepresentationForTypeIdentifier:(NSString *)typeIdentifier fileOptions:(NSItemProviderFileOptions)fileOptions visibility:(NSItemProviderRepresentationVisibility)visibility loadHandler:(NSProgress * _Nullable (^)(void (^completionHandler)(NSURL *url, BOOL coordinated, NSError *error)))loadHandler;

Discussion

If a destination app must access the represented file using a file coordinator, set the coordinated parameter in the load handler block to YES.

To offer a representation backed by a file provider, return an NSURL object that points to your app’s file provider’s container. The file provider extension is then invoked to retrieve the file when requested.

To offer a representation backed by a file to open in place, set the fileOptions parameter to a value of NSItemProviderFileOptionOpenInPlace; in addition, return an NSURL object that points to your app’s file provider’s container. Open-in-place support requires that the file provider is visible in the Files app.

See Also

Providing the Item’s Data

- registerDataRepresentationForTypeIdentifier:visibility:loadHandler:

Registers a data-backed representation for an item, specifiying item visibility and a load handler.

- registerObject:visibility:

Adds representations of a specified object to an item provider, based on the object’s implementation of the NSItemProviderWriting protocol and adhering to a visibility specification.

- registerObjectOfClass:visibility:loadHandler:

Lazily adds representations of a specified object to an item provider, based on the object’s implementation of the NSItemProviderWriting protocol and adhering to a visibility specification.

suggestedName

The filename to use when writing the provided data to a file on disk.