<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "XPC",
  "identifier" : "/documentation/XPC/XPCDictionary/subscript(_:as:default:)-51ffh",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Subscript",
  "symbol" : {
    "kind" : "Instance Subscript",
    "modules" : [
      "XPC"
    ],
    "preciseIdentifier" : "s:3XPC13XPCDictionaryV_2as7default6System14FileDescriptorVSS_AHmAHyXKtcip"
  },
  "title" : "subscript(_:as:default:)"
}
-->

# subscript(_:as:default:)

Get a value in this dictionary as a file descriptor.

```
subscript(key: String, as type: FileDescriptor.Type = FileDescriptor.self, default defaultValue: @autoclosure () -> FileDescriptor) -> FileDescriptor { get }
```

## Parameters

`key`

The key under which to get the file descriptor.

`type`

The expected type of the resulting value.

`defaultValue`

The value to produce if no file descriptor is available
under `key`.

## Return Value

A file descriptor value, possibly `defaultValue`.

## Overview

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

---

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)