Input content type - iOS
On iOS, you can set a content type by using the textContentType
property.
The following values are defined in UITextContentType
:
addressCity
: entering a cityaddressCityAndState
: entering a city and stateaddressState
: entering a statecountryName
: entering a countrycreditCardNumber
: entering a credit card numberdateTime
: entering a date, time, or durationemailAddress
: entering an email addressfamilyName
: entering a family name, or last nameflightNumber
: entering an airline flight numberfullStreetAddress
: entering a street address that fully identifies a locationgivenName
: entering a first namejobTitle
: entering a job titlelocation
: entering a locationmiddleName
: entering a middle namename
: entering a namenamePrefix
: entering a prefix or titlenameSuffix
: entering a suffixnewPassword
: entering a new passwordnickname
: entering a nicknameoneTimeCode
: entering a one-time codeorganizationName
: entering an organization namepassword
: entering a passwordpostalCode
: entering a postal codeshipmentTrackingNumber
: entering a parcel tracking numberstreetAddressLine1
: entering the first line of an addressstreetAddressLine2
: entering the second line of an addresssublocality
: entering a sublocalitytelephoneNumber
: entering a telephone numberURL
: entering a URLusername
: entering a username
Example of using textContentType
:
emailField.textContentType = .emailAddress