Instance Method

completeRequestReturningItems:completionHandler:

Tells the host app to complete the app extension request with an array of result items.

Declaration

- (void)completeRequestReturningItems:(NSArray *)items completionHandler:(void (^)(BOOL expired))completionHandler;

Parameters

items

An array of result items, each an NSExtensionItem object, to return to the host app.

completionHandler

An optional block to be called when the request completes, performed as a background priority task.

The block takes the following parameter:

expired

A Boolean value that indicates whether the system is terminating a previous invocation of the completionHandler block.

This parameter is YES when the system prematurely terminates a completionHandler block that was previously invoked and had not otherwise expired.

Discussion

Calling this method eventually dismisses the app extension’s view controller.

See Also

Handling Requests

cancelRequestWithError:

Tells the host app to cancel the app extension request, with a supplied error.