---
title: "decodeIfPresent(_:forKey:configuration:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/keyeddecodingcontainer/decodeifpresent(_:forkey:configuration:)-5g1cl"
---

# decodeIfPresent(_:forKey:configuration:)

## Declaration

```swift
func decodeIfPresent<T, C>(_: T.Type, forKey key: KeyedDecodingContainer<K>.Key, configuration: C.Type) throws -> T? where T : DecodableWithConfiguration, C : DecodingConfigurationProviding, T.DecodingConfiguration == C.DecodingConfiguration
```
