All Collections
Labels Hidden Modifier
Labels Hidden Modifier

Hide the labels of any controls contained within a layer.

Updated over a week ago

Use the Labels Hidden modifier when you want to omit a label from one or more controls in your user interface.

However, note that the Labels Hidden modifier doesn’t work for all labels. It applies to labels that are separate from the rest of the control’s interface, like they are for a Toggle, but not to controls like a Bordered Button where the label is inside the Button’s border.

The first Toggle in the following example hides its label.


It’s still important to provide a label for controls, even when you hide the label, because SwiftUI uses labels for other purposes, including accessibility.

Did this answer your question?