How to interpret trackpad pinch gestures to zoom IKImageBrowserView
- by Fraser Speirs
I have an IKImageBrowserView that I want to be able to pinch-zoom using a multi-touch trackpad on a recent Mac laptop.
The Cocoa Event Handling Guide, in the section Handling Gesture Events says:
The magnification accessor method returns a floating-point (CGFloat) value representing a factor of magnification
..and goes on to show code that adjusts the size of the view by multiplying height and width by magnification + 1.0.
This doesn't seem to be the right approach for zooming IKImageBrowserView, whose zoomValue property is clamped between 0.0 and 1.0.
So, does anyone know how to interpret the event in -[NSResponder magnifyWithEvent:] to zoom IKImageBrowserView?