---
title: "subscript(_:as:default:)"
framework: xpc
role: symbol
role_heading: Instance Subscript
path: "xpc/xpcarray/subscript(_:as:default:)-46zsb"
---

# subscript(_:as:default:)

Get a value in this array as an endpoint.

## Declaration

```swift
subscript(index: Int, as type: XPCEndpoint.Type = XPCEndpoint.self, default defaultValue: @autoclosure () -> XPCEndpoint) -> XPCEndpoint { get }
```

## Parameters

- `index`: The index at which to get the endpoint.
- `type`: The expected type of the resulting value.
- `defaultValue`: The value to produce if no endpoint is available at index.

## Return Value

Return Value An endpoint value, possibly defaultValue.
