Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I implement gesture recognizers in OS X?

I have done quite a bit with gesture recognizers for iOS, but I am now doing work in OS X, and I am lost.

I want to duplicate the functionality that exists like in Finder where you can two-finger swipe (on your magic mouse) to go back/forward through a directory tree.

I have an NSWindow based app that looks very similar to Finder. I have used apps before that allows you to build your own gesture recognizers so I know it is possible to do it, but I don't see any documentation on it.

What do I need to do to implement these gestures?

like image 477
Westley Avatar asked May 29 '12 19:05

Westley


1 Answers

Mac now has:

  • NSClickGestureRecognizer
  • NSMagnificationGestureRecognizer
  • NSPanGestureRecognizer
  • NSPressGestureRecognizer
  • NSRotationGestureRecognizer

Available in storyboards too.

like image 75
Rudolf Adamkovič Avatar answered Nov 01 '22 08:11

Rudolf Adamkovič