<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSControl/abortEditing()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSControl(im)abortEditing"
  },
  "title" : "abortEditing()"
}
-->

# abortEditing()

Terminates the current editing operation and discards any edited text.

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

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if there was a field editor associated with the control; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## 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(_:)`](/documentation/AppKit/NSControlTextEditingDelegate/controlTextDidEndEditing(_:)).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)