如何在swift的Accessibility中使用点击手势? [英] How to use tap gesture in Accessibility in swift?

查看:331
本文介绍了如何在swift的Accessibility中使用点击手势?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为盲人开发应用程序首先我需要使用轻扫手势,搜索后我可以使用

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

推荐答案

您可以覆盖 accessibilityScroll 方法:

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
}

这篇关于如何在swift的Accessibility中使用点击手势?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆