<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextContentType",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:@T@NSTextContentType"
  },
  "title" : "NSTextContentType"
}
-->

# NSTextContentType

Constants that identify the semantic meaning for a text-entry area.

```
struct NSTextContentType
```

## Discussion

Use these constants with the [`contentType`](/documentation/AppKit/NSTextContent/contentType) property.

## Topics

### Creating a content type

[`init(rawValue:)`](/documentation/AppKit/NSTextContentType/init(rawValue:))

Creates a new content type with the raw value you provide.

### Defining web addresses

[`NSTextContentTypeURL`](/documentation/AppKit/NSTextContentType/URL)

A property that defines the content in a text input area as a URL.

### Identifying contacts

[`NSTextContentTypeNamePrefix`](/documentation/AppKit/NSTextContentType/namePrefix)

A property that defines the content in a text input area as a prefix or title, such as *Dr*.

[`NSTextContentTypeName`](/documentation/AppKit/NSTextContentType/name)

A property that defines the content in a text input area as a name.

[`NSTextContentTypeNameSuffix`](/documentation/AppKit/NSTextContentType/nameSuffix)

A property that defines the content in a text input area as a suffix, such as *Jr*.

[`NSTextContentTypeGivenName`](/documentation/AppKit/NSTextContentType/givenName)

A property that defines the content in a text input area as a first name.

[`NSTextContentTypeMiddleName`](/documentation/AppKit/NSTextContentType/middleName)

A property that defines the content in a text input area as a middle name.

[`NSTextContentTypeFamilyName`](/documentation/AppKit/NSTextContentType/familyName)

A property that defines the content in a text input area as a family name, or last name.

[`NSTextContentTypeNickname`](/documentation/AppKit/NSTextContentType/nickname)

A property that defines the content in a text input area as a nickname.

[`NSTextContentTypeOrganizationName`](/documentation/AppKit/NSTextContentType/organizationName)

A property that defines the content in a text input area as an organization name.

[`NSTextContentTypeJobTitle`](/documentation/AppKit/NSTextContentType/jobTitle)

A property that defines the content in a text input area as a job title.

### Setting location data

[`NSTextContentTypeLocation`](/documentation/AppKit/NSTextContentType/location)

A property that defines the content in a text input area as a location, such as a point of interest, an address, or another identifier for a location.

[`NSTextContentTypeFullStreetAddress`](/documentation/AppKit/NSTextContentType/fullStreetAddress)

A property that defines the content in a text input area as a street address that fully identifies a location.

[`NSTextContentTypeStreetAddressLine1`](/documentation/AppKit/NSTextContentType/streetAddressLine1)

A property that defines the content in a text input area as the first line of a street address.

[`NSTextContentTypeStreetAddressLine2`](/documentation/AppKit/NSTextContentType/streetAddressLine2)

A property that defines the content in a text input area as the second line of a street address.

[`NSTextContentTypeAddressCity`](/documentation/AppKit/NSTextContentType/addressCity)

A property that defines the content in a text input area as a city name.

[`NSTextContentTypeAddressCityAndState`](/documentation/AppKit/NSTextContentType/addressCityAndState)

A property that defines the content in a text input area as a city name with a state name.

[`NSTextContentTypeAddressState`](/documentation/AppKit/NSTextContentType/addressState)

A property that defines the content in a text input area as a state name.

[`NSTextContentTypePostalCode`](/documentation/AppKit/NSTextContentType/postalCode)

A property that defines the content in a text input area as a postal code.

[`NSTextContentTypeSublocality`](/documentation/AppKit/NSTextContentType/sublocality)

A property that defines the content in a text input area as a sublocality.

[`NSTextContentTypeCountryName`](/documentation/AppKit/NSTextContentType/countryName)

A property that defines the content in a text input area as a country or region name.

### Managing accounts

[`NSTextContentTypeUsername`](/documentation/AppKit/NSTextContentType/username)

A property that defines the content in a text input area as an account or login name.

[`NSTextContentTypePassword`](/documentation/AppKit/NSTextContentType/password)

A property that defines the content in a text input area as a password.

[`NSTextContentTypeNewPassword`](/documentation/AppKit/NSTextContentType/newPassword)

A property that defines the content in a text input area as a new password.

### Securing accounts

[`NSTextContentTypeOneTimeCode`](/documentation/AppKit/NSTextContentType/oneTimeCode)

A property that defines the content in a text input area as a one-time code.

### Setting communication details

[`NSTextContentTypeEmailAddress`](/documentation/AppKit/NSTextContentType/emailAddress)

A property that defines the content in a text input area as an email address.

[`NSTextContentTypeTelephoneNumber`](/documentation/AppKit/NSTextContentType/telephoneNumber)

A property that defines the content in a text input area as a telephone number.

### Accepting payment

[`NSTextContentTypeCreditCardNumber`](/documentation/AppKit/NSTextContentType/creditCardNumber)

A property that defines the content in a text input area as a credit card number.

[`NSTextContentTypeCreditCardExpiration`](/documentation/AppKit/NSTextContentType/creditCardExpiration)

A property that defines the content in a text input area as an expiration date on a credit card.

[`NSTextContentTypeCreditCardExpirationMonth`](/documentation/AppKit/NSTextContentType/creditCardExpirationMonth)

A property that defines the content in a text input area as the month component of an expiration date on a credit card.

[`NSTextContentTypeCreditCardExpirationYear`](/documentation/AppKit/NSTextContentType/creditCardExpirationYear)

A property that defines the content in a text input area as the year component of an expiration date on a credit card.

[`NSTextContentTypeCreditCardSecurityCode`](/documentation/AppKit/NSTextContentType/creditCardSecurityCode)

A property that defines the content in a text input area as a credit card security code.

[`NSTextContentTypeCreditCardType`](/documentation/AppKit/NSTextContentType/creditCardType)

A property that defines the content in a text input area as a credit card type.

[`NSTextContentTypeCreditCardName`](/documentation/AppKit/NSTextContentType/creditCardName)

A property that defines the content in a text input area as a name on a credit card.

[`NSTextContentTypeCreditCardGivenName`](/documentation/AppKit/NSTextContentType/creditCardGivenName)

A property that defines the content in a text input area as a first name on a credit card.

[`NSTextContentTypeCreditCardMiddleName`](/documentation/AppKit/NSTextContentType/creditCardMiddleName)

A property that defines the content in a text input area as a middle name on a credit card.

[`NSTextContentTypeCreditCardFamilyName`](/documentation/AppKit/NSTextContentType/creditCardFamilyName)

A property that defines the content in a text input area as a family name, or last name, on a credit card.

### Getting birthday information

[`NSTextContentTypeBirthdate`](/documentation/AppKit/NSTextContentType/birthdate)

A property that defines the content in a text input area as a date of birth.

[`NSTextContentTypeBirthdateDay`](/documentation/AppKit/NSTextContentType/birthdateDay)

A property that defines the content in a text input area as the day component of a birthdate.

[`NSTextContentTypeBirthdateMonth`](/documentation/AppKit/NSTextContentType/birthdateMonth)

A property that defines the content in a text input area as the month component of a birthdate.

[`NSTextContentTypeBirthdateYear`](/documentation/AppKit/NSTextContentType/birthdateYear)

A property that defines the content in a text input area as the year component of a birthdate.

### Scheduling events

[`NSTextContentTypeDateTime`](/documentation/AppKit/NSTextContentType/dateTime)

A property that defines the content in a text input area as a date, time, or duration.

### Tracking events

[`NSTextContentTypeFlightNumber`](/documentation/AppKit/NSTextContentType/flightNumber)

A property that defines the content in a text input area as an airline flight number.

[`NSTextContentTypeShipmentTrackingNumber`](/documentation/AppKit/NSTextContentType/shipmentTrackingNumber)

A property that defines the content in a text input area as a parcel tracking number.

## Relationships

### Conforms To

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`Equatable`](/documentation/Swift/Equatable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`Hashable`](/documentation/Swift/Hashable)

---

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)