Setting accessibility identifier programmatically on UIBarButtonItem

后端 未结 4 1796
深忆病人
深忆病人 2021-02-12 08:25

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:44

    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.

提交回复
热议问题