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

# hasText

A Boolean value that indicates whether the text-entry object has any text.

```
var hasText: Bool { get }
```

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the backing store has textual content, <doc://com.apple.documentation/documentation/Swift/false> otherwise.

## Discussion

---

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)