How do i use the UIPinchGestureRecognizer
for multiple purposes? At the moment i am using it to zoom in/out of my GLKView, but i would like to use the gesture to move around (pan/tilt), but at the same time being able to zoom. I have seen this behaviour in many CAD and 3D App's on iOS.
Code for pinching:
- (void)pinchDetected:(UIPinchGestureRecognizer *)pinchRecognizer
{
NSLog (@"%@", @"Pinching");
if (pinchRecognizer.state == UIGestureRecognizerStateBegan ||
pinchRecognizer.state == UIGestureRecognizerStateChanged ||
pinchRecognizer.state == UIGestureRecognizerStateEnded) {
_zoom += (-1)*(logf(pinchRecognizer.scale) * 10.0f);
pinchRecognizer.scale = 1.0;
}
}