nicklockwood / iCarousel

A simple, highly customisable, data-driven 3D carousel for iOS and Mac OS
http://www.charcoaldesign.co.uk/source/cocoa#icarousel
Other
12k stars 2.58k forks source link

Pinch and Pan gestures in iCarousel item #766

Open andrealufino opened 7 years ago

andrealufino commented 7 years ago

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.

priyankamistry09 commented 7 years ago

Hi, Any update on this? I need to implement the same.

andrealufino commented 7 years ago

Nothing for now, I'm sorry.