---
title: currentEditor()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nscontrol/currenteditor()
---

# currentEditor()

Returns the current field editor for the control.

## Declaration

```swift
func currentEditor() -> NSText?
```

## Return Value

Return Value The field editor for the current control, or nil if the receiver does not have a field editor.

## Discussion

Discussion When the receiver is a control displaying editable text (for example, a text field) and it is the first responder, it has a field editor, which is returned by this method. The field editor is a single NSTextView object that is shared among all the controls in a window for light text-editing needs. It is automatically instantiated when needed.

## See Also

### Managing the Field Editor

- [abortEditing()](appkit/nscontrol/abortediting().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)
