File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff 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)
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments