<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITextField/clearsOnBeginEditing",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UITextField(py)clearsOnBeginEditing"
  },
  "title" : "clearsOnBeginEditing"
}
-->

# clearsOnBeginEditing

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

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

## Discussion

If this property is set to <doc://com.apple.documentation/documentation/Swift/true>, the text field’s previous text is cleared when the user selects the text field to begin editing. If <doc://com.apple.documentation/documentation/Swift/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 <doc://com.apple.documentation/documentation/Swift/true>, the text field delegate can override this behavior by returning <doc://com.apple.documentation/documentation/Swift/false> from its ``doc://com.apple.uikit/documentation/UIKit/UITextFieldDelegate/textFieldShouldClear(_:)`` method.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)