---
title: clearsOnBeginEditing
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uitextfield/clearsonbeginediting
---

# clearsOnBeginEditing

A Boolean value that determines whether the text field removes old text when editing begins.

## Declaration

```swift
var clearsOnBeginEditing: Bool { get set }
```

## Discussion

Discussion If this property is set to true, the text field’s previous text is cleared when the user selects the text field to begin editing. If false, the text field places an insertion point at the place where the user tapped the field. note: Even if this property is set to true, the text field delegate can override this behavior by returning false from its textFieldShouldClear(_:) method.

## See Also

### Managing the editing behavior

- [isEditing](uikit/uitextfield/isediting.md)
- [clearsOnInsertion](uikit/uitextfield/clearsoninsertion.md)
- [allowsEditingTextAttributes](uikit/uitextfield/allowseditingtextattributes.md)
- [UITextField.DidEndEditingReason](uikit/uitextfield/didendeditingreason.md)
- [didEndEditingReasonUserInfoKey](uikit/uitextfield/didendeditingreasonuserinfokey.md)
- [textDidBeginEditingNotification](uikit/uitextfield/textdidbegineditingnotification.md)
- [textDidChangeNotification](uikit/uitextfield/textdidchangenotification.md)
- [textDidEndEditingNotification](uikit/uitextfield/textdidendeditingnotification.md)
