<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "XPC",
  "identifier" : "/documentation/XPC/XPCDictionary/subscript(_:as:)-7rdzi",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Subscript",
  "symbol" : {
    "kind" : "Instance Subscript",
    "modules" : [
      "XPC"
    ],
    "preciseIdentifier" : "s:3XPC13XPCDictionaryV_2asAA11XPCEndpointVSgSS_AFmtcip"
  },
  "title" : "subscript(_:as:)"
}
-->

# subscript(_:as:)

Get an `XPCEndpoint` value in this dictionary.

```
subscript(key: String, as type: XPCEndpoint.Type = XPCEndpoint.self) -> XPCEndpoint? { get }
```

## Parameters

`key`

The key under which to get the xpc endpoint.

`type`

The expected type of the resulting value.

## Return Value

A previously-set endpoint value. If no endpoint was previously
set for `key`, returns `nil`.

---

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)