---
title: decodeNil()
framework: swift
role: symbol
role_heading: Instance Method
path: swift/unkeyeddecodingcontainer/decodenil()
---

# decodeNil()

Decodes a null value.

## Declaration

```swift
mutating func decodeNil() throws -> Bool
```

## Return Value

Return Value Whether the encountered value was null.

## Discussion

Discussion If the value is not null, does not increment currentIndex. note: DecodingError.valueNotFound if there are no more values to decode.
