---
title: discardMarkedText()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nstextinputcontext/discardmarkedtext()
---

# discardMarkedText()

Tells the Cocoa text input system to discard the current conversion session.

## Declaration

```swift
func discardMarkedText()
```

## Discussion

Discussion The client should clear its marked range when sending this message.

## See Also

### Handling Input Sources

- [handleEvent(_:)](appkit/nstextinputcontext/handleevent(_:).md)
- [invalidateCharacterCoordinates()](appkit/nstextinputcontext/invalidatecharactercoordinates().md)
- [keyboardInputSources](appkit/nstextinputcontext/keyboardinputsources.md)
- [selectedKeyboardInputSource](appkit/nstextinputcontext/selectedkeyboardinputsource.md)
- [localizedName(forInputSource:)](appkit/nstextinputcontext/localizedname(forinputsource:).md)
- [NSTextInputSourceIdentifier](appkit/nstextinputsourceidentifier.md)
