16

I'm using UIPageViewController in my App, however I noticed that when Voice Over is enabled, the "three finger swipe" shortcut does not work (like it does on home screen). Does anyone know if there is a standard way to enable this (like most other VO features)? Or do I need to manually detect swipe gestures myself.

Epic Byte
  • 33,840
  • 12
  • 45
  • 93

2 Answers2

17

Ok after much searching I found that I need to override the method below to detect the VO Swipe. From there I can manually present the next and previous view controllers.

-(BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction {

    if (direction == UIAccessibilityScrollDirectionRight) {
      //Previous Page

    } else if (direction == UIAccessibilityScrollDirectionLeft) {
     //Next Page   
    }

    return YES;
}
Epic Byte
  • 33,840
  • 12
  • 45
  • 93
  • 2
    Note that you should swap your next and previous to behave as expected. Swiping to the right should show the previous page, swiping to the left should show the next page. – Jordan H Dec 29 '14 at 00:21
3

Thanks Epic, this helped me a lot! Just thought I would add a Swift version for folks.

Swift 4.0:

override func accessibilityScroll(_ direction: UIAccessibilityScrollDirection) -> Bool {
    if direction == .right {
        // Previous Page
    } else if direction == .left  {
        // Next Page
    } 
    return true
}
Shalin Shah
  • 8,145
  • 6
  • 31
  • 44
D. Pratt
  • 444
  • 8
  • 15