I have an ImageView, and Images URL in array. I want to download and show these images on UIImageView, but issue this that I am facing Two Gestures on that View, so inner Gesture which is on only ImageView is not looking to work.
My code is like below
[self.imageView setUserInteractionEnabled:YES];
UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipe:)];
UISwipeGestureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipe:)];
// Setting the swipe direction.
[swipeLeft setDirection:UISwipeGestureRecognizerDirectionLeft];
[swipeRight setDirection:UISwipeGestureRecognizerDirectionRight];
// Adding the swipe gesture on image view
[self.imageView addGestureRecognizer:swipeLeft];
[self.imageView addGestureRecognizer:swipeRight];
- (void)handleSwipe:(UISwipeGestureRecognizer *)swipe {
if (swipe.direction == UISwipeGestureRecognizerDirectionLeft) {
NSLog(@"Left Swipe");
}
if (swipe.direction == UISwipeGestureRecognizerDirectionRight) {
NSLog(@"Right Swipe");
}
}
The method handleSwipe is not called and also when I move it opens side menu, as there is Gesture applied same as facebook side menu opens in its iOS app.
How can I change images in ImageView when whole parent view is also using Gesture.
Thanks