---
title: "init(stringValue:)"
framework: swift
role: symbol
role_heading: Initializer
path: "swift/codingkey/init(stringvalue:)"
---

# init(stringValue:)

Creates a new instance from the given string.

## Declaration

```swift
init?(stringValue: String)
```

## Parameters

- `stringValue`: The string value of the desired key.

## Discussion

Discussion If the string passed as stringValue does not correspond to any instance of this type, the result is nil.
