---
title: clearButtonMode
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uitextfield/clearbuttonmode
---

# clearButtonMode

A mode that controls when the standard Clear button appears in the text field.

## Declaration

```swift
var clearButtonMode: UITextField.ViewMode { get set }
```

## Discussion

Discussion The standard clear button displays at the right side of the text field when the text field has contents, providing a way for the user to remove text quickly. This button appears automatically based on the value of this property. The default value for this property is UITextField.ViewMode.never.

## See Also

### Managing overlay views

- [leftView](uikit/uitextfield/leftview.md)
- [leftViewMode](uikit/uitextfield/leftviewmode.md)
- [rightView](uikit/uitextfield/rightview.md)
- [rightViewMode](uikit/uitextfield/rightviewmode.md)
- [UITextField.ViewMode](uikit/uitextfield/viewmode.md)
