- Platforms
- Foundations
-
Patterns
- Overview
- Accessing private data
- Charting data
- Collaboration and sharing
- Drag and drop
- Entering data
- Feedback
- File management
- Going full screen
- Launching
- Live-viewing apps
- Loading
- Managing accounts
- Managing notifications
- Modality
- Multitasking
- Offering help
- Onboarding
- Playing audio
- Playing haptics
- Playing video
- Printing
- Ratings and reviews
- Searching
- Settings
- Undo and redo
- Workouts
-
Components
- All components
- Content
- Layout and organization
- Menus and actions
- Navigation and search
- Presentation
- Selection and input
- Status
- System experiences
- Inputs
-
Technologies
- All technologies
- AirPlay
- Always On
- App Clips
- Apple Pay
- Augmented reality
- CareKit
- CarPlay
- Game Center
- HealthKit
- HomeKit
- iCloud
- ID Verifier
- In-app purchase
- Live Photos
- Mac Catalyst
- Machine learning
- Maps
- Messages for Business
- NFC
- Photo editing
- ResearchKit
- SharePlay
- ShazamKit
- Sign in with Apple
- Siri
- Tap to Pay on iPhone
- Wallet
Labels
A label is a static piece of text that people can read and often copy, but not edit.
Labels display text throughout the interface, in buttons, menu items, and views, helping people understand the current context and what they can do next.
The term label refers to uneditable text that can appear in various places. For example:
- Within a button, a label generally conveys what the button does, such as Edit, Cancel, or Send.
- Within many lists, a label can describe each item, often accompanied by a symbol or an image.
- Within a view, a label might provide additional context by introducing a control or describing a common action or task that people can perform in the view.
The guidance below can help you use a label to display text. In some cases, guidance for specific components — such as buttons, menus, and lists — includes additional recommendations for using text.
Best practices
Use a label to display a small amount of text that people don’t need to edit. If you need to let people edit a small amount of text, use a text field. If you need to display a large amount of text, and optionally let people edit it, use a text view.
Prefer system fonts. A label can display plain or styled text, and it supports Dynamic Type (where available) by default. If you adjust the style of a label or use custom fonts, make sure the text remains legible.
Use system-provided label colors to communicate relative importance. The system defines four label colors that vary in appearance to help you give text different levels of visual importance. For additional guidance, see Color.
System color | Example usage | iOS, iPadOS, tvOS | macOS |
---|---|---|---|
Label | Primary information | labelColor | labelColor |
Secondary label | A subheading or supplemental text | secondaryLabelColor | secondaryLabelColor |
Tertiary label | Text that describes an unavailable item or behavior | tertiaryLabelColor | tertiaryLabelColor |
Quaternary label | Watermark text | quaternaryLabelColor | quaternaryLabelColor |
Make useful label text selectable. If a label contains useful information — like an error message, a location, or an IP address — consider letting people select and copy it for pasting elsewhere.
Platform considerations
No additional considerations for iOS, iPadOS, or tvOS.
macOS
DEVELOPER NOTE To display uneditable text in a label, use the isEditable property of NSTextField.
watchOS
In addition to using SwiftUI Label and Text components in your watchOS app, you can use WatchKit date and timer labels to display real-time values.
A date label (shown below on the left) displays the current date, the current time, or a combination of both. You can configure a date label to use a variety of formats, calendars, and time zones. After configuration, a date label updates its value without further input from your app. A timer label (shown below on the right) displays a precise countdown or count-up timer. You can configure a timer label to display its count value in a variety of formats. After configuration, a timer label counts down or up without further input from your app.
Date label
Timer label
Consider using date and timer labels in complications. When you use the system-provided date and timer labels, watchOS automatically adjusts the presentation of the label content to fit the available space. For guidance, see Complications; for developer guidance, see CLKRelativeDateTextProvider.