Text Fields

A text field is a single-line, fixed-height field that automatically brings up a keyboard when people tap it. Use a text field to request a small amount of information, such as a name or an email address.

Show a hint in a text field to help communicate its purpose. A text field can contain placeholder text — such as "Email" or "Password" — when there’s no other text in the field. Avoid using a separate label to describe a text field when placeholder text is sufficient.

Display a Clear button in the trailing end of a text field to help people erase their input. When this element is present, people can tap it to clear the text field’s contents, without having to keep tapping the Delete key.

Use secure text fields to hide private data. Always use a secure text field when your app asks for sensitive data, such as a password.

Use images and buttons to provide clarity and functionality in text fields. You can display custom images in both ends of a text field, or you can add a system-provided button, such as the Bookmarks button. In general, use the leading end of a text field to indicate a field’s purpose and the trailing end to offer additional features, such as bookmarking.

For developer guidance, see UITextField.

TIP For multiline or multistyle text entry, use a text view instead. See Text Views.