<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSExtensionContext/completeRequest(returningItems:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSExtensionContext(im)completeRequestReturningItems:completionHandler:"
  },
  "title" : "completeRequest(returningItems:completionHandler:)"
}
-->

# completeRequest(returningItems:completionHandler:)

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

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

## Parameters

`items`

An array of result items, each an [`NSExtensionItem`](/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:

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

    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

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)