Skip to content
This repository was archived by the owner on Nov 24, 2021. It is now read-only.

Commit 697ca44

Browse files
authored
Pr/84 (#85)
* Set default maximum zoom scale factor to 1 instead of 0 * Update maximumZoomScale when updating image * Double tap to zoom * Improve zoom to a point * Print touch point * Move zoomToPoint to extension * Add double tap gesture recogniser to the Zoom Scroll View * Zoom to point working * Only add double-tap-to-zoom if it is an image
1 parent 59675d7 commit 697ca44

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

Source/ViewableController.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,13 @@ class ViewableController: UIViewController {
145145
tapRecognizer.numberOfTapsRequired = 1
146146
self.view.addGestureRecognizer(tapRecognizer)
147147

148-
let doubleTapRecognizer = UITapGestureRecognizer(target: self, action: #selector(ViewableController.doubleTapAction))
149-
doubleTapRecognizer.numberOfTapsRequired = 2
150-
self.zoomingScrollView.addGestureRecognizer(doubleTapRecognizer)
151-
152-
tapRecognizer.require(toFail: doubleTapRecognizer)
148+
if viewable?.type == .image {
149+
let doubleTapRecognizer = UITapGestureRecognizer(target: self, action: #selector(ViewableController.doubleTapAction))
150+
doubleTapRecognizer.numberOfTapsRequired = 2
151+
self.zoomingScrollView.addGestureRecognizer(doubleTapRecognizer)
152+
153+
tapRecognizer.require(toFail: doubleTapRecognizer)
154+
}
153155
}
154156

155157
// In iOS 10 going into landscape provides a very strange animation. Basically you'll see the other

0 commit comments

Comments
 (0)