Setting accessibility identifier on a xib file
Asked Answered
O

2

5

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.

Orthodoxy answered 20/12, 2012 at 22:27 Comment(0)
T
7

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".

Tartaglia answered 20/12, 2012 at 22:30 Comment(2)
On my Xcode it says "Restoration ID" (instead of identifier) under Identity ... Any idea whether its same or not?? I am using XCode 4.5.2.Orthodoxy
I confused this with Cocoa, there isn't an "identifier" field, you have to set it up manually, I changed the picture and edited the post.Tartaglia
E
2

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

Eutrophic answered 20/12, 2012 at 22:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.