April 2015
Intermediate to advanced
556 pages
17h 47m
English
Gesture recognizers, which were added in OS X 10.10, provide a higher-level means of handling mouse input. If you have used UIKit’s gesture recognizers on iOS you will find them very familiar.
Each gesture recognizer is designed to recognize one specific gesture:
NSClickGestureRecognizer
NSPanGestureRecognizer
NSMagnificationGestureRecognizer
NSPressGestureRecognizer
NSRotationGestureRecognizer
Gesture recognizers are added to a specific view and report the gestures using target/action, just like controls:
func setupPan() { let pan = NSPanGestureRecognizer(target: self, action: Selector("pan:")) someView.addGestureRecognizer(pan) } func pan(pan: NSClickGestureRecognizer) { let location: ...Read now
Unlock full access