VoiceOver: label, value, hint and traits
Essence
VoiceOver is the screen reader: the user drags a finger or swipes between elements, and the system reads their description. An element's description is assembled from several properties, each with its own role.
isAccessibilityElement— whether VoiceOver sees this view as a separate element. It'strueby default forUILabel,UIButtonandUISwitch, andfalsefor containerUIViews.accessibilityLabel— what it is: "Share", "Anna's avatar". Short, capitalized, without the word "button".accessibilityValue— the current value that changes: "3 of 5", "70 percent", "on".accessibilityTraits— role and state:.button,.header,.link,.selected,.notEnabled,.adjustable,.image. VoiceOver adds "button" or "heading" itself based on the trait.accessibilityHint— what will happen, if it isn't obvious: "Opens profile settings". Read after a pause; users can turn hints off.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep