---
title: abortEditing()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nscontrol/abortediting()
---

# abortEditing()

Terminates the current editing operation and discards any edited text.

## Declaration

```swift
func abortEditing() -> Bool
```

## Return Value

Return Value true if there was a field editor associated with the control; otherwise, false.

## Discussion

Discussion If there was a field editor, this method removes the field editor’s delegate. Because the control discards any edits, it doesn’t call controlTextDidEndEditing(_:).

## See Also

### Managing the Field Editor

- [currentEditor()](appkit/nscontrol/currenteditor().md)
- [validateEditing()](appkit/nscontrol/validateediting().md)
- [edit(withFrame:editor:delegate:event:)](appkit/nscontrol/edit(withframe:editor:delegate:event:).md)
- [endEditing(_:)](appkit/nscontrol/endediting(_:).md)
- [select(withFrame:editor:delegate:start:length:)](appkit/nscontrol/select(withframe:editor:delegate:start:length:).md)
