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

# subscript(_:as:)

Get a value in this dictionary as a file descriptor.

## Declaration

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

## Parameters

- `key`: The key under which to get the file descriptor.
- `type`: The expected type of the resulting value.

## Return Value

Return Value A file descriptor value or nil if no such value was found.

## Overview

Overview The returned file descriptor is owned by the caller so they must close it.
