---
title: NSScriptCoercionHandler
framework: foundation
role: symbol
role_heading: Class
path: foundation/nsscriptcoercionhandler
---

# NSScriptCoercionHandler

A mechanism for converting one kind of scripting data to another.

## Declaration

```swift
class NSScriptCoercionHandler
```

## Overview

Overview A shared instance of this class coerces (converts) object values to objects of another class using information supplied by classes that register with it. Coercions frequently are required during key-value coding.

## Topics

### Accessing the application’s handler

- [shared()](foundation/nsscriptcoercionhandler/shared().md)

### Working with handlers

- [coerceValue(_:to:)](foundation/nsscriptcoercionhandler/coercevalue(_:to:).md)
- [registerCoercer(_:selector:toConvertFrom:to:)](foundation/nsscriptcoercionhandler/registercoercer(_:selector:toconvertfrom:to:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### NSObject Script Support

- [NSComparisonMethods](foundation/nscomparisonmethods.md)
- [NSScriptingComparisonMethods](objectivec/nsscriptingcomparisonmethods.md)
- [NSScriptKeyValueCoding](objectivec/nsscriptkeyvaluecoding.md)
- [NSScriptObjectSpecifiers](foundation/nsscriptobjectspecifiers.md)
- [NSScriptExecutionContext](foundation/nsscriptexecutioncontext.md)
