---
title: "init(forName:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/valuetransformer/init(forname:)"
---

# init(forName:)

Returns the value transformer identified by a given identifier.

## Declaration

```swift
init?(forName name: NSValueTransformerName)
```

## Parameters

- `name`: The transformer identifier.

## Return Value

Return Value The value transformer identified by name in the shared registry, or nil if not found.

## Discussion

Discussion If valueTransformerForName: does not find a registered transformer instance for name, it will attempt to find a class with the specified name. If a corresponding class is found an instance will be created and initialized using its init: method and then automatically registered with name.

## See Also

### Using the Name-Based Registry

- [setValueTransformer(_:forName:)](foundation/valuetransformer/setvaluetransformer(_:forname:).md)
- [valueTransformerNames()](foundation/valuetransformer/valuetransformernames().md)
- [NSValueTransformerName](foundation/nsvaluetransformername.md)
