调用 UIGestureRecognizers 目标 &行动

发布于 2024-09-18 14:44:38 字数 254 浏览 4 评论 0原文

我使用 initWithTarget 构造函数以及 addTargetremoveTarget 方法编写了 UIGestureRecognizer 的子类。

现在,我的问题是我无法找到任何访问器或辅助方法来调用这些目标操作。

我相信应该有任何目标和操作的列表/数组......

文档在这个特定问题上有些薄弱。

感谢您的帮助,

亚历克斯

I wrote a subclass of UIGestureRecognizer using the initWithTarget constructor as well as addTarget, removeTarget methods.

Now, my problem is that I am unable to find any accessors or helper methods to call these targets actions.

I believe there should be any List/Array of targets and actions ...

The docs are somehow weak in that particular question.

Thanks for any help,

Alex

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北渚 2024-09-25 14:44:38

超类会为你处理这个问题。您只需将 state 设置为正确的值即可:

self.state = UIGestureRecognizerStateRecognized

请阅读 仔细指导,包括那里的示例识别器。

The superclass handles that for you. You just need to set the state to the correct value:

self.state = UIGestureRecognizerStateRecognized

Please read the guide carefully, including the example recognizer there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文