<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/textContentType(_:)-ufdv",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE15textContentTypeyQrSo06UITexteF0aSgF"
  },
  "title" : "textContentType(_:)"
}
-->

# textContentType(_:)

Sets the text content type for this view, which the system uses to
offer suggestions while the user enters text on an iOS or tvOS device.

```
nonisolated func textContentType(_ textContentType: UITextContentType?) -> some View
```

## Parameters

`textContentType`

One of the content types available in the
<doc://com.apple.documentation/documentation/UIKit/UITextContentType>
structure that identify the semantic meaning expected for a text-entry
area. These include support for email addresses, location names, URLs,
and telephone numbers, to name just a few.

## Discussion

Use this method to set the content type for input text.
For example, you can configure a [`TextField`](/documentation/SwiftUI/TextField) for the entry of email
addresses:

```
TextField("Enter your email", text: $emailAddress)
    .textContentType(.emailAddress)
```

---

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)