I am going through the Sample code of iPhone WWDC 2010 - 104 PhotoScroller App. It\'s working great with my project related images (PDF Page Images)
but I am struggl
This appears to work using convertRect:fromView: and zoomToRect:animated::
-(void)tap:(UITapGestureRecognizer *)tapGestureRecognizer
{
CGFloat zoomeScaleMultiplier = 0.5;
UIScrollView *scrollView = (UIScrollView *) tapGestureRecognizer.view;
UIView *zoomableView = [scrollView.delegate viewForZoomingInScrollView:scrollView];
CGRect rect = scrollView.bounds;
rect.origin = CGPointZero;
CGAffineTransform transform = CGAffineTransformMakeScale(zoomeScaleMultiplier, zoomeScaleMultiplier);
rect = CGRectApplyAffineTransform(rect, transform);
rect.origin = [tapGestureRecognizer locationInView:scrollView];
rect = CGRectOffset(rect, CGRectGetWidth(rect)/-2., CGRectGetHeight(rect)/-2.);
rect = [zoomableView convertRect:rect fromView:scrollView];
[scrollView zoomToRect:rect animated:YES];
}