3

I have two questions regarding accessibility and UICollectionViews that I'm hoping to get some expert help with. The other question, regarding Voice Over read order, is here. I've created a sample project demonstrating both issues.

I have a UICollectionView where I'm providing custom section headers. These section headers are accessibility elements and have the accessibility trait UIAccessibilityTraitHeader set. When Voice Over is enabled, and the user is swiping horizontally through the collection, the header is announced properly, and it is even declared as a header. However, if the user swipes up or down to the next header, Voice Over will only jump to another header if it is visible. I'm assuming this is because when a view isn't visible in a collection view, it's removed from the view hierarchy and Voice Over no longer knows it exists.

You can pull this example project, run it, enable voice over, and use the dial to set the swipe up/down to headings to view the issue.

Is there a way I can allow the user to jump to a header that is not currently visible? Any help would be greatly appreciated.

Community
  • 1
  • 1
Jose Ibanez
  • 3,325
  • 3
  • 28
  • 33

1 Answers1

0

You might have to use the scrollToItemAtIndexPath:atScrollPosition:animated: property of the UICollectionView to scroll the header into view before VoiceOver can read it.

You can find out which indexPath you are currently at via indexPathForItemAtPoint: using the position of where they touched within the collection view and then you know which section comes after.

iwasrobbed
  • 46,496
  • 21
  • 150
  • 195
  • I'm not sure I follow. I don't think that when Voice Over is enabled you receive tap notifications in the traditional way; however, I can hook into when a cell receives accessibility focus. Unfortunately, I don't know how to detect when the user has swiped up or down to know when to scroll to the previous or next section. I'm pretty sure `accessibilityScroll` is the three-finger scroll gesture, not the one finger swipe I'm looking for. – Jose Ibanez Apr 29 '13 at 23:23
  • I honestly haven't used Voice Over enough to tell you. This should help you with how to hook my code above into the callback: http://stackoverflow.com/a/15616144/308315 – iwasrobbed Apr 29 '13 at 23:28