<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "XPC",
  "identifier" : "/documentation/XPC/XPCArray/subscript(_:as:)-5g1u8",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Subscript",
  "symbol" : {
    "kind" : "Instance Subscript",
    "modules" : [
      "XPC"
    ],
    "preciseIdentifier" : "s:3XPC8XPCArrayV_2asAA11XPCEndpointVSgSi_AFmtcip"
  },
  "title" : "subscript(_:as:)"
}
-->

# subscript(_:as:)

Get a value in this array as an endpoint.

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

## Parameters

`index`

The index at which to get the endpoint.

`type`

The expected type of the resulting value.

## Return Value

An endpoint value or `nil` if no such value was found.

---

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)