Skip to content

Instantly share code, notes, and snippets.

@augustj
Created July 23, 2014 16:47
Show Gist options
  • Save augustj/15ead6a7484b02748cd5 to your computer and use it in GitHub Desktop.
Save augustj/15ead6a7484b02748cd5 to your computer and use it in GitHub Desktop.
Category on UIView to enable accessibility on DEBUG builds for KIF testing
-(void)enableAccessibilityForIdentifier:(NSString *)identifier {
//This is only used to help with KIF testing, so we don't need/want them in production
#ifdef DEBUG
[self setValue:identifier forKey:@"accessibilityIdentifier"];
self.accessibilityLabel = identifier;
self.isAccessibilityElement = TRUE;
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment