xcodelabelaccessibilityhint

Xcode's Accessibility Label vs Hint vs Id


I searched but could not find an up-to-date question, so here goes:

Could someone let me know what Xcodes Accessibility Label vs Hint vs Id are used for? I think it might be label and hint are used for voiced navigation and Id's are only used for automation, but not sure if that is right?


Solution

  • You are correct.

    The 'Label' property will be used in voice over representing the element itself. If Labels are not set manually, they will be filled in at runtime based on the content of the element. IE: "Comment Delete Button"

    'Hints' are also used in voice over assistance but are a more descriptive representation of the element. IE: "This button allows users to delete a comment."

    'identifier' is used for automation and quick query of the UI element. IE: "CommentDeleteButton"

    The Label and Hint can be localized and therefore will vary between languages while the identifier remains the same.

    https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/iPhoneAccessibility/Accessibility_on_iPhone/Accessibility_on_iPhone.html#//apple_ref/doc/uid/TP40008785-CH100-SW1