cashapp / AccessibilitySnapshot

Easy regression testing for iOS accessibility
Apache License 2.0
534 stars 65 forks source link

Support the private "back button" trait that UINavigationBar uses for back buttons #216

Open kyleve opened 2 months ago

kyleve commented 2 months ago

UIAccessibilityTraits contains a private trait that is used for back buttons in UINavigationController, on _UIButtonBarButton in particular:

(lldb) po button
▿ Optional<UIControl>
  - some : <_UIButtonBarButton: 0x1026336d0 ... >

(lldb) p button?.accessibilityTraits
(UIAccessibilityTraits?) 134217728

(lldb) po String(134217728, radix: 2)
"1000000000000000000000000000"

This allows VoiceOver to speak "back button" for the control kind, instead of just the regular "button".

I'm already working through a contribution to support this, so filing an issue!

https://github.com/cashapp/AccessibilitySnapshot/pull/217