Top
Tag iOS Views
  • 22 Sep 2022
  • 1 Minute To Read
  • Dark
    Light
  • PDF

Tag iOS Views

  • Dark
    Light
  • PDF

Article summary

Why should you tag iOS views?

Whatfix Mobile identifies the screen of native apps uniquely with the properties of an element like accessibility identifier, accessibility label, and tag on the screen. Adding these properties helps in identifying the element and hence the screen more accurately.

Add Tag, Accessibility Identifier, and Accessibility Label to a view

your title goes here

You can set either tag, accessibilityLabel, or accessibilityIdentifier to make it uniquely identifiable on the current screen.

Swift

view.tag = 101 // unique value for the view
view.accessibilityLabel = "cart_button" // unique label for the view
view.accessibilityIdentifier = "cart_button" // unique identifer for the view

Objective C

view.tag = 101;
view.accessibilityLabel = @"cart_button";
view.accessibilityIdentifier = @"cart_button";


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.