How to interpret trackpad pinch gestures to zoom IKImageBrowserView

Posted by Fraser Speirs on Stack Overflow See other posts from Stack Overflow or by Fraser Speirs
Published on 2009-11-27T09:12:35Z Indexed on 2010/05/04 16:28 UTC
Read the original article Hit count: 327

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?

© Stack Overflow or respective owner

Related posts about imagekit

Related posts about ikimagebrowserview