---
title: "selectText(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsmatrix/selecttext(_:)"
---

# selectText(_:)

Selects text in the currently selected cell or in the key cell.

## Declaration

```swift
func selectText(_ sender: Any?)
```

## Discussion

Discussion If the currently selected cell is editable and enabled, its text is selected. Otherwise, the key cell is selected.

## See Also

### Related Documentation

- [selectText(_:)](appkit/nstextfield/selecttext(_:).md)
- [keyCell](appkit/nsmatrix/keycell.md)

### Editing Text in Cells

- [selectText(atRow:column:)](appkit/nsmatrix/selecttext(atrow:column:).md)
- [textShouldBeginEditing(_:)](appkit/nsmatrix/textshouldbeginediting(_:).md)
- [textDidBeginEditing(_:)](appkit/nsmatrix/textdidbeginediting(_:).md)
- [textDidChange(_:)](appkit/nsmatrix/textdidchange(_:).md)
- [textShouldEndEditing(_:)](appkit/nsmatrix/textshouldendediting(_:).md)
- [textDidEndEditing(_:)](appkit/nsmatrix/textdidendediting(_:).md)
