How can I implement gesture recognizers in OS X?

淺唱寂寞╮ 提交于 2019-12-04 02:27:34

You can read about Handling Trackpad Events in the Cocoa Event Handling guide. The system can detect some pre-defined gestures (swipe, rotate, etc.) or you can listen to the raw touch events, which travel up the NSResponder chain, just like regular mouse events.

Mac now has:

  • NSClickGestureRecognizer
  • NSMagnificationGestureRecognizer
  • NSPanGestureRecognizer
  • NSPressGestureRecognizer
  • NSRotationGestureRecognizer

Available in storyboards too.

Looks like there is also an Event Recognizer class in CZKit. https://github.com/CarterA/CZKit

I haven't used this (yet), so YMMV.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!