tech_human
tech_human

Reputation: 7104

Setting accessibility identifier on a xib file

I have a xib file which has a view. Under a view, I have few labels... I am working on UIAutomation and hence want to add accessibility identifiers to the view and each of these labels. How can I do it inside the xib? I googled and found that a field named "identifier" should be used... but I cannot see any suck field for view and label.

Please suggest.

Upvotes: 5

Views: 4247

Answers (2)

Ramy Al Zuhouri
Ramy Al Zuhouri

Reputation: 21966

Here:

enter image description here

You have to set it up manually, so add a key pressing the + button, change the type to String and the name to "identifier".

Upvotes: 7

cream-corn
cream-corn

Reputation: 1840

in the "Identity Inspector" (3rd tab)

You Will see a header "User Defined Runtime attributes" there you need to add the key "accessibilityIdentifier" of type string and the value is your id :)

Upvotes: 2

Related Questions