What's the difference between setAccessibilityLabel and accessibilityIdentifier in ios?

前端 未结 4 489
感情败类
感情败类 2021-01-31 14:32

I\'ve been going through our code base and setting the accessibilityIdentifier property on all of our buttons and text fields so that I can access them using UIAutomation. While

4条回答
  •  感情败类
    2021-01-31 14:56

    Instead of using accessibilityLabel (see below) you should use accessibilityIdentifier.

    This github issue explains the difference:

    Given that accessibilityLabel is an outwardly-facing string that is actually used by accessibility screen readers (and should be localized to the device user's language), Apple now provides an alternate property (iOS 5+) that is specifically intended for UI Automation purposes

提交回复
热议问题