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

# subscript(_:as:default:)

Get a value in this array as an XPCArray.

## Declaration

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

## Parameters

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

## Return Value

Return Value An XPCArray value, possibly defaultValue.
