---
title: "windowWillReturnFieldEditor(_:to:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nswindowdelegate/windowwillreturnfieldeditor(_:to:)"
---

# windowWillReturnFieldEditor(_:to:)

Tells the delegate that the field editor for a text-displaying object has been requested.

## Declaration

```swift
@MainActor optional func windowWillReturnFieldEditor(_ sender: NSWindow, to client: Any?) -> Any?
```

## Parameters

- `sender`: The window requesting the field editor from the delegate.
- `client`: A text-displaying object to be associated with the field editor. If nil, the requested field editor is the default.

## Return Value

Return Value The field editor for client; returns nil when the delegate has no field editor to assign.

## See Also

### Related Documentation

- [fieldEditor(_:for:)](appkit/nswindow/fieldeditor(_:for:).md)
