Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图弄清楚如何在 UIGestureRecognizer 检测到手势后调用动作,当它“失去焦点”(用户将手指从屏幕上抬起)。所以基本上,如果用户向上滑动手指,然后将手指从屏幕上抬起,我怎么能检测到手指被抬起了?
您可以使用“状态”属性来检测用户最终刷卡的时间。
- (void)handleSwipeGesture:(UISwipeGestureRecognizer *)recognizer { if (recognizer.state == UIGestureRecognizerStateEnded) { //do something } }