简体   繁体   English

可可触摸-拖到按钮上以触发事件

[英]Cocoa Touch - Drag onto button to trigger event

Hey all, just wondering what the best way to add this capability was. 大家好,想知道添加此功能的最佳方法是什么。

I want to be able to press the button normally by doing touchDownInside, but I also want to be able to slide my finger from one button to the next and have the next one trigger. 我希望能够通过执行touchDownInside来正常按下按钮,但是我也希望能够将手指从一个按钮滑动到另一个按钮,并获得下一个触发器。

How can I do that? 我怎样才能做到这一点?

Ex: 例如:

(-) -> (-) (-)->(-)
^Buttons^ ^按钮^

您可以实现touchesEnded方法,并检查触摸点是否在按钮的任何框架内。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM