Created
January 19, 2014 09:47
-
-
Save douglashill/8502588 to your computer and use it in GitHub Desktop.
iOS: log UIAccessibility related properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// NSObject+AccessibilityInspect.h | |
// Created by Douglas Hill on 29/09/2012. | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSObject (AccessibilityInspect) | |
- (void)logAccessibiltyProperties; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// NSObject+AccessibilityInspect.m | |
// Created by Douglas Hill on 29/09/2012. | |
// | |
#import "NSObject+AccessibilityInspect.h" | |
@implementation NSObject (AccessibilityInspect) | |
- (void)logAccessibiltyProperties | |
{ | |
NSLog(@"Accessibilty properties for %@", self); | |
NSLog(@"- - - - - - - - - - - - - - - - - - - -"); | |
NSLog(@"Activation Point: %@", NSStringFromCGPoint([self accessibilityActivationPoint])); | |
NSLog(@"Elements Hidden: %c", [self accessibilityElementsHidden]); | |
NSLog(@"Frame: %@", NSStringFromCGRect([self accessibilityFrame])); | |
NSLog(@"Hint: %@", [self accessibilityHint]); | |
NSLog(@"Label: %@", [self accessibilityLabel]); | |
NSLog(@"Language: %@", [self accessibilityLanguage]); | |
NSLog(@"Traits: %llu", [self accessibilityTraits]); | |
NSLog(@"Value: %@", [self accessibilityValue]); | |
NSLog(@"View Is Modal: %c", [self accessibilityViewIsModal]); | |
NSLog(@"- - - - - - - - - - - - - - - - - - - -"); | |
NSInteger count = [self accessibilityElementCount]; | |
if (count == NSIntegerMax) { | |
NSLog(@"Accessibility element count is NSIntegerMax"); | |
return; | |
} | |
NSLog(@"Accessibility element count: %d", count); | |
for (int index = 0; index < count; index++) { | |
NSLog(@"Accessibility Element At Index %d: %@", index, [self accessibilityElementAtIndex:index]); | |
} | |
NSLog(@"- - - - - - - - - - - - - - - - - - - -"); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment