ImageSlideshow
ImageSlideshow copied to clipboard
Tap to dismiss the full-screen image
Issue created upon the feature request from other user. The gesture is conflicting with double tap to zoom-in so this needs to be addressed.
My suggestion ( no iOS coding skills ) is to have a timeout after the first tap. If the timeout fully runs dry, trigger the dismissal, otherwise trigger the zoom in.
At least that is how I'd do it in javascript and it's foolproof. The timeout should be configurable.
Was the same task, maybe this helps
//BACK
UITapGestureRecognizer *tapToGoBack;
if (tapToGoBack == nil) {
tapToGoBack = [[UITapGestureRecognizer alloc] initWithTarget: self action: @selector(goBackTap)];
[tapToGoBack setNumberOfTapsRequired: 1];
}
[self.collectionView addGestureRecognizer: tapToGoBack];
//ZOOM
UITapGestureRecognizer *tapToZoomImage;
if (tapToZoomImage == nil) {
tapToZoomImage = [[UITapGestureRecognizer alloc] initWithTarget: self action: @selector(zoomImageTap)];
[tapToZoomImage setNumberOfTapsRequired: 2];
}
[self.collectionView addGestureRecognizer: tapToZoomImage];
[tapToGoBack requireGestureRecognizerToFail:tapToZoomImage];
If it works, you should create a PR @NikKovV.