RuleID

@objc public enum RuleID: Int

A unique identifier for each Rule.

  • Detects which elements require an accessibility hint and ensures that one is provided. Only views with accessibility hints will pass. Views that do not require accessibility hints will be inapplicable.

    Declaration

    Swift

    case AccessibilityHint
  • Detects which UIViews do not have an adequate color contrast between the UIView’s background color and its text color. Only views with a color contrast of 4.5:1 or higher will pass. Views without text will be inapplicable.

    Declaration

    Swift

    case ColorContrast
  • Detects which UIViews have confusing and/or conflicting UIAccessibilityTraits. Only views without conflicting traits will pass. Non-accessibility elements will be inapplicable.

    Declaration

    Swift

    case ConflictingTraits
  • Detects which UIViews have overlapping accessibility frames. If accessibility frames overlap, VoiceOver will have trouble focusing on the element. Only views that are accessibility elements and do not intersect with other accessibility elements will pass. Non-accessibility elements will be inapplicable.

    Important

    The Accessibility Inspector must be on and focused on the simulator/device in order to get correct results. All results may not appear in automated testing, but will appear in manual testing.

    Declaration

    Swift

    case DontIntersect
  • Detects which UIViews contain text that do not change size according to user preference. Only views with text that are capable of resizing will pass. Views without text will be inapplicable.

    Declaration

    Swift

    case DynamicType
  • Detects which UIViews have accessibility paths that do not encapsulate their own visual frames. VoiceOver uses accessibilityPaths to show the user which element is currently focused. A UIView’s accessibilityPath is supposed to encapsulate at least its own UIView. Only views that do this will pass. Non-accessibility elements will be inapplicable.

    Important

    This Rule only works in manual testing.

    Declaration

    Swift

    case InHighlight
  • Detects which accessibility elements are contained within other accessibility elements. If an accessibility element is a superview of another accessibility element, VoiceOver will only focus on the superview, and the user will not be able to interact with the inner accessibility element. Only views that do not have accessibility elements as superviews will pass. Non-accessibility elements will be inapplicable.

    Declaration

    Swift

    case NestedA11yElements
  • Detects which UIViews need accessibilityLabels. Only views that already have an accessibilityLabel should pass.

    Declaration

    Swift

    case SpeakableText
  • Detects which UIViews are too small for comfortable user interaction. This analyzes elements that are active controls and have User Interaction enabled. Only views that are large enough for a user to easily tap will pass. Views that are not active controls (such as UILabels) will be inapplicable.

    Declaration

    Swift

    case TouchTargetSize