---
title: "completeRequest(returningItems:completionHandler:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsextensioncontext/completerequest(returningitems:completionhandler:)"
---

# completeRequest(returningItems:completionHandler:)

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

## Declaration

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

## Parameters

- `items`: An array of result items, each an doc://com.apple.foundation/documentation/Foundation/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: This parameter is doc://com.apple.documentation/documentation/Swift/true when the system prematurely terminates a completionHandler block that was previously invoked and had not otherwise expired. important: If the system calls your block with an expired value of doc://com.apple.documentation/documentation/Swift/true, you must immediately suspend your app extension. If you fail to do this, the system terminates your extension’s process. When your app extension exits, all concurrent requests being handled by the extension, serving the same or other host apps, are terminated.

## Discussion

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

## See Also

### Handling requests

- [cancelRequest(withError:)](foundation/nsextensioncontext/cancelrequest(witherror:).md)
- [NSExtensionItemsAndErrorsKey](foundation/nsextensionitemsanderrorskey.md)
