---
title: "subscript(_:as:)"
framework: xpc
role: symbol
role_heading: Instance Subscript
path: "xpc/xpcdictionary/subscript(_:as:)-7rdzi"
---

# subscript(_:as:)

Get an XPCEndpoint value in this dictionary.

## Declaration

```swift
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

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