NSValueTransformer is an abstract class that is used by the Cocoa Bindings technology to transform values from one representation to another.
- iOS 3.0+
- macOS 10.3+
- tvOS 3.0+
- watchOS 2.0+
An application creates a subclass of
NSValueTransformer, overriding the necessary methods to provide the required custom transformation.
A relatively trivial value transformer takes an object of type
id and returns a string based on the object’s class type. This transformer is not reversible as it’s probably unreasonable to transform a class name into an object. The value transformer class you write to accomplish this simple task could look like: