---
title: cancelComposition()
framework: InputMethodKit
role: symbol
role_heading: Instance Method
platforms: [macOS 10.5+]
path: inputmethodkit/imkinputcontroller/cancelcomposition()
---

# cancelComposition()

Stops the current composition and replaces marked text with the original text.

## Declaration

```swift
func cancelComposition()
```

## Discussion

Discussion This method calls the method originalString: to obtain the original text and sends that text to the client using a call to the IMKTextInput  protocol method insertText(_:replacementRange:)

## See Also

### Managing Composition

- [updateComposition()](inputmethodkit/imkinputcontroller/updatecomposition().md)
