A continuous gesture recognizer for panning (dragging) gestures.
SDK
- macOS 10.10+
Framework
- App
Kit
Declaration
class NSPanGestureRecognizer : NSGesture Recognizer
Overview
The gesture is recognized when the user clicks all of specified buttons, drags the mouse, and releases one or more of the buttons. Use the pan gesture recognizer object to retrieve the distance traveled during the pan and the location of the mouse as it pans.
Upon creation, the gesture recognizer is configured to recognize pan gestures involving only the primary button. It also delays sending primary button events to the view by setting the delays
property to true
. To change the set of buttons to track, modify the button
property.
In this gesture recognizer, the location(in:)
method always reports the current mouse point, which changes as the user drags the mouse.