【发布时间】:2016-09-01 23:55:32
【问题描述】:
故事板上有三个UIButtons。
什么是最直接的检测时间的方法:
- 同时按下两个
UIButtons?
或
- 同时按下三个
UIButtons?
【问题讨论】:
-
不知道是否有意义,我觉得它很有趣..
-
如果按钮被突出显示,它当前被按下例如
if button.highlighted && button2.highlighted -
并且您可以检查与任一按钮连接的函数内的代码,因此当单击一个按钮时,它会检查是否也单击了其他按钮
-
使用 3 次触摸的 UITapGestureRecognizer 实例然后在委托中使用可能是正确的方法 - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch: check touches location with CGRectContainsPoint..
标签: ios swift uibutton storyboard uitouch