---
title: "encode(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/unkeyedencodingcontainer/encode(_:)-7cs0h"
---

# encode(_:)

Encodes the given value.

## Declaration

```swift
mutating func encode(_ value: UInt32) throws
```

## Parameters

- `value`: The value to encode.

## Discussion

Discussion note: EncodingError.invalidValue if the given value is invalid in the current context for this format.
