Mobile: Programmatically

Accessibility can get very complex by adding in gesture, traits, etc. but for the purposes of Appcues ALL YOU HAVE TO DO IS  ENABLE ACCESSIBILITY AND SET An IDENTIFIER

This approach should only be done for views that are built programmatically or views that are altered programmatically in any way. If you have views in interface builder refer to Interface Builder - Accessibility and/or Interface Builder - Runtime because it is much quicker to tag elements that way. 

  1. It is best practice to set the Accessibility ID when the UI element itself gets initiated. This is usually set in one of the app lifecycle methods viewDidLoad(), viewWillAppear(), viewDidAppear(), etc. 
  2. Set the property of isAccessibilityElement to true for the UI element. 
  3. Set the accessibilityIdentifier to a unique name. The more unique the identifier the better but be sure to not add any special characters to the Identifier as this may cause some undesired behavior.