<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 13.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ExtensionKit",
  "identifier" : "/documentation/ExtensionKit/EXHostViewController/makeXPCConnection()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ExtensionKit"
    ],
    "preciseIdentifier" : "c:objc(cs)EXHostViewController(im)makeXPCConnectionWithError:"
  },
  "title" : "makeXPCConnection()"
}
-->

# makeXPCConnection()

Initiates an XPC connection to the app extension’s scene.

```
func makeXPCConnection() throws -> NSXPCConnection
```

## Discussion

Call this method from the [`hostViewControllerDidActivate(_:)`](/documentation/ExtensionKit/EXHostViewControllerDelegate/hostViewControllerDidActivate(_:))
method to initiate a scene-specific connection to the app extension.

---

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)