Skip to content

Commit 8bdd235

Browse files
authored
Okay just disable swipe down entirely
1 parent 74e6b4c commit 8bdd235

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Source/Library/LightboxTransition.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class LightboxTransition: UIPercentDrivenInteractiveTransition {
1212

1313
var interactive = false
1414
var dismissing = false
15-
var animateDismissal = true
15+
var isEnabled = true
1616
var initialOrigin = CGPoint(x: 0, y: 0)
1717

1818
var scrollView: UIScrollView? {
@@ -39,6 +39,7 @@ class LightboxTransition: UIPercentDrivenInteractiveTransition {
3939
// MARK: - Pan gesture recognizer
4040

4141
@objc func handlePanGesture(_ gesture: UIPanGestureRecognizer) {
42+
if isEnabled { return }
4243
let translation = gesture.translation(in: scrollView)
4344
let percentage = abs(translation.y) / UIScreen.main.bounds.height / 1.5
4445
let velocity = gesture.velocity(in: scrollView)
@@ -47,7 +48,7 @@ class LightboxTransition: UIPercentDrivenInteractiveTransition {
4748
case .began:
4849
interactive = true
4950
lightboxController?.presented = false
50-
lightboxController?.dismiss(animated: animateDismissal, completion: nil)
51+
lightboxController?.dismiss(animated: true, completion: nil)
5152
if let origin = scrollView?.frame.origin { initialOrigin = origin }
5253
case .changed:
5354
update(percentage)

Source/LightboxController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ open class LightboxController: UIViewController {
149149

150150
open var animateTransition: Bool = true {
151151
didSet {
152-
transitionManager.animateDismissal = animateTransition
152+
transitionManager.isEnabled = animateTransition
153153
}
154154
}
155155

0 commit comments

Comments
 (0)