How to add accessibility identifiers for custom views?

How to add accessibility identifiers for custom views? if we set a key value pair accessibilityIdentifier in swift file, its not being detected by the automation tool and also the instruments. Please help me get this.

myCustomView.accessibilityIdentifier = "<some string>" should work, could you provide a little more info?

you can set the accessibility identifiers like ishaq mentioned above but you might also have to set

customView.isAccessibilityElement = true


to make the Accessibility framework actually see the element.

How to add accessibility identifiers for custom views?
 
 
Q