Input label on iOS
Input fields should have labels so that users know what input data is expected. These labels should stay visible while users are entering data. A placeholder which disappears while entering data does not count as a label.
On iOS, there is no attribute to link a label to an input field. We recommend combining UILabel
with a UITextField
. Set isAccessibilityElement
to false
for the label, and set the text of the label as accessibilityLabel
for the field.
label.text = "Name"
label.isAccessibilityElement = false
field.accessibilityLabel = label.text