Skip to content

Commit

Permalink
Adds possibility to disable swipe-to-dismiss
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleš Kocur committed Apr 17, 2016
1 parent f3ca28b commit d9616a6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Pod/Classes/Core/ZoomAnimatedTransitioning.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ public class ZoomAnimatedTransitioningDelegate: NSObject, UIViewControllerTransi
var gestureRecognizer: UIPanGestureRecognizer!
private var interactionController: UIPercentDrivenInteractiveTransition?

/// Enables or disables swipe-to-dismiss
public var slideToDismissEnabled: Bool = true

public init(slideshowView: ImageSlideshow, slideshowController: FullScreenSlideshowViewController) {
self.referenceSlideshowView = slideshowView
self.referenceSlideshowController = slideshowController
Expand Down Expand Up @@ -77,6 +80,10 @@ extension ZoomAnimatedTransitioningDelegate: UIGestureRecognizerDelegate {
return false
}

if !slideToDismissEnabled {
return false
}

if let currentItem = referenceSlideshowController?.slideshow.currentSlideshowItem where currentItem.isZoomed() {
return false
}
Expand Down

0 comments on commit d9616a6

Please sign in to comment.