Contents

completeRequest(returningItems:completionHandler:)

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

Declaration

func completeRequest(returningItems items: [Any]?, completionHandler: (@Sendable (Bool) -> Void)? = nil)

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 True 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