Setting accessibility identifier programmatically on UIBarButtonItem

后端 未结 4 1879
轻奢々
轻奢々 2021-02-12 08:26

The accessibility identifier is a developer generated ID for GUI objects, which can be used for automation tests.

A UIBarButtonItem does not implement

4条回答
  •  隐瞒了意图╮
    2021-02-12 08:46

    The subclassing UIBarButtonItem is a good solution. Depending on your needs, though, it may make more sense to simply assign the accessibilityIdentifier to the custom image of your UIBarButtonItem, assuming your UIBarButtonItem uses a custom image.

提交回复
热议问题