3

I'm working on app for blind people first i needed to use swipe gesture and after search i can do it by using

 override func accessibilityScroll( direction:       
 UIAccessibilityScrollDirection)-> Bool {
 if direction == UIAccessibilityScrollDirection.Left
 {
   Do what you want to do 
   }
 }

Now I need to use tap gesture and I can't find any function to use make custom tap in Accessibility can anyone help me pleasee! Thanks

2 Answers2

0

You shouldn't use tap gesture for UIAccessibility ot try to add tap gestures to UIAccessibility.UIAccessibility is meant for the UIElements where the people can see/hear what is on the screen. You cannot add UIAccessiility for tap gesture functions. What you can do is to post a accessibility notification to the user saying tap to perform something. Again, you need to use buttons to perform an action in UIAccessibility.

Teja Nandamuri
  • 11,045
  • 6
  • 57
  • 109
0

You can override accessibilityScroll method:

override func accessibilityScroll(_ direction: 
    UIAccessibilityScrollDirection) -> Bool {

    super.accessibilityScroll(direction)

    if direction == UIAccessibilityScrollDirection.left {
    // do your stuff            
    }

    if direction == UIAccessibilityScrollDirection.right {
    // do your stuff        
    }
    return true
}
Masih
  • 1,633
  • 4
  • 19
  • 38