views:

82

answers:

0

Hello !

I'm working on the example code named PhotoScroller (an Apple's example of WWDC 2010).
There is an UIScrollView which return a custom UIView when zooming

- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {

    return imageView;

}

The layer of this imageView is a CATiledLayer.
My problem is for each zoom the drawRect of the imageView is called (so 10 or 30 times for a basic zoom). And then it refresh ALL the screen (so the size given to drawrect in fact).
I would like to refresh some parts of the UIImageView when a zoom occured and not all the screen (so by using setNeedDisplayInRect: instead of setNeedDisplay).
But I don't know how to proceed to avoid the call of this refresh method to do some if else and so refresh some parts of the imageView.

I tried to add an other UIView between the UIScrollView and the subclassed uiview (with catiledlayer). But I don't know how to prevent the subviews to be refreshed :-/

If anyone has an idea, It would be very helpful !

Thanks :-)
Vincent