I want to set a Identifier to my text boxes and buttons, because I want to automate my app using Appium.
So my question is, in Xcode, what can I do to set a Id for my options, Its possible to do that, because all the programs that I have inspect has a id.
Method 1: Changing the Text Field Type from storyboard. Select the text field that you want to restrict to numeric input. Go to its attribute inspector. Select the keyboard type and choose number pad from there.
An object that displays an editable text area in your interface.
You just need to give it an accessibility identifier.
You can add this as a user defined runtime attribute, do it in code or the easiest is to add it through the property inspector.
Code
titleLabel.accessibilityIdentifier = "titleLabel"
Property Inspector
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With