From 6b64f75c8d27d8a1ec3e81310237d0937df4f4ff Mon Sep 17 00:00:00 2001 From: ghysrc Date: Fri, 13 May 2016 15:18:26 +0800 Subject: [PATCH] add single tap to dismiss --- SKPhotoBrowser/SKZoomingScrollView.swift | 6 +++++- .../SKPhotoBrowserExample/ViewController.swift | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/SKPhotoBrowser/SKZoomingScrollView.swift b/SKPhotoBrowser/SKZoomingScrollView.swift index 8f45e82..a13c314 100644 --- a/SKPhotoBrowser/SKZoomingScrollView.swift +++ b/SKPhotoBrowser/SKZoomingScrollView.swift @@ -307,7 +307,11 @@ public class SKZoomingScrollView: UIScrollView, UIScrollViewDelegate, SKDetectin // MARK: - SKDetectingImageViewDelegate func handleImageViewSingleTap(touchPoint: CGPoint) { - photoBrowser?.performCloseAnimationWithScrollView(self) + if photoBrowser!.enableSingleTapDismiss { + photoBrowser?.performCloseAnimationWithScrollView(self) + } else { + photoBrowser?.toggleControls() + } } func handleImageViewDoubleTap(touchPoint: CGPoint) { diff --git a/SKPhotoBrowserExample/SKPhotoBrowserExample/ViewController.swift b/SKPhotoBrowserExample/SKPhotoBrowserExample/ViewController.swift index 85b199b..260c9a2 100644 --- a/SKPhotoBrowserExample/SKPhotoBrowserExample/ViewController.swift +++ b/SKPhotoBrowserExample/SKPhotoBrowserExample/ViewController.swift @@ -89,6 +89,7 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection browser.displayDeleteButton = true browser.statusBarStyle = .LightContent browser.bounceAnimation = true +// browser.enableSingleTapDismiss = true // Can hide the action button by setting to false browser.displayAction = true