0

I'm trying to implement a zoom feature for an iCarousel item view. This is my code :

NSString *pathToHDImage = [documentsFolderPath stringByAppendingPathComponent:solution.localHDURL];

if (!view) {

    view = [[AsyncImageView alloc] initWithFrame:self.view.bounds];
    view.contentMode = UIViewContentModeScaleAspectFit;

    UIPinchGestureRecognizer *pinchGesture = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinch:)];
    pinchGesture.cancelsTouchesInView = false;
    UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)];
    panGesture.cancelsTouchesInView = false;

    pinchGesture.delegate = panGesture.delegate = self;

    [view addGestureRecognizer:pinchGesture];
    [view addGestureRecognizer:panGesture];

    ((AsyncImageView *)view).imageURL = [NSURL fileURLWithPath:pathToHDImage];
} else
    ((AsyncImageView *)view).imageURL = [NSURL fileURLWithPath:pathToHDImage];

The problem is that my handlePan: and handlePinch: never get called. How can I do? The main goal is to implement zoom feature for every iCarousel item view.

Andrea Mario Lufino
  • 7,921
  • 12
  • 47
  • 78

1 Answers1

0

Try this Code:

 - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
    {
    return YES;
    }

I did not test but I hope it helps. In case it does not work check out this link1 and then this link2

Community
  • 1
  • 1
Md. Ibrahim Hassan
  • 5,359
  • 1
  • 25
  • 45