I found the solution to my problem. I just have to add again the gestures in the scrollViewDidEndZooming delegate method and it works like a charm :
Here is my code :
- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale {
// set the new scale factor for the TiledImageView
imageScale *=scale;
CGRect imageRect = CGRectMake(0.0f,0.0f,CGImageGetWidth(image.CGImage) * imageScale,CGImageGetHeight(image.CGImage) * imageScale);
// Create a new TiledImageView based on new frame and scaling.
frontTiledView = [[TiledImageView alloc] initWithFrame:imageRect image:image scale:imageScale];
[self addSubview:frontTiledView];
[frontTiledView release];
if (imageRect.size.width < 320 || imageRect.size.height < 460)
[self initGestures];
}
- (void)initGestures {
self.canCancelContentTouches = NO;
frontTiledView.exclusiveTouch = YES;
backgroundImageView.exclusiveTouch = YES;
backTiledView.exclusiveTouch = YES;
UIPanGestureRecognizer* panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(move:)];
[panGesture setMinimumNumberOfTouches:1];
[panGesture setMaximumNumberOfTouches:1];
[panGesture setDelegate:self];
[frontTiledView addGestureRecognizer:panGesture];
UIPanGestureRecognizer* panGesture2 = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(move:)];
[panGesture2 setMinimumNumberOfTouches:1];
[panGesture2 setMaximumNumberOfTouches:1];
[panGesture2 setDelegate:self];
[backgroundImageView addGestureRecognizer:panGesture2];
UIPanGestureRecognizer* panGesture3 = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(move:)];
[panGesture3 setMinimumNumberOfTouches:1];
[panGesture3 setMaximumNumberOfTouches:1];
[panGesture3 setDelegate:self];
[backTiledView addGestureRecognizer:panGesture3];
}