Setting accessibility identifier programmatically on UIBarButtonItem
问题 The accessibility identifier is a developer generated ID for GUI objects, which can be used for automation tests. A UIBarButtonItem does not implement UIAccessibilityIdentification . However is there a possibility that I can assign an accessibility identifier? 回答1: You could subclass UIBarButtonItem and implement the UIAccessibilityIdentification protocol in that subclass, lets's say BarButtonWithAccesibility . In BarButtonWithAccesibility.h : @interface BarButtonWithAccesibility :