<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/UnkeyedDecodingContainer/decode(_:)-5eszo",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s24UnkeyedDecodingContainerP6decodeys5Int32VAEmKF"
  },
  "title" : "decode(_:)"
}
-->

# decode(_:)

Decodes a value of the given type.

```
mutating func decode(_ type: Int32.Type) throws -> Int32
```

## Parameters

`type`

The type of value to decode.

## Return Value

A value of the requested type, if present for the given key
and convertible to the requested type.

## Discussion> throws: `DecodingError.typeMismatch` if the encountered encoded value
> is not convertible to the requested type.

> throws: `DecodingError.valueNotFound` if the encountered encoded value
> is null, or of there are no more values to decode.

---

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)