PullToDismissTransition icon indicating copy to clipboard operation
PullToDismissTransition copied to clipboard

Fix the "jumping" bug. — Occasionally, the transition jumps, or in the Simulator gets stuck.

Open benguild opened this issue 7 years ago • 5 comments

benguild avatar Aug 29 '18 15:08 benguild

So the jumping bug I'm experiencing is when the pan gesture begins, but is flung back up at velocity to cancel. The modal jumps to a point about -50%, -50% off the screen.

Eliminating this line, seems to do the trick as otherwise, stopPullToDismiss is called twice (when progress is zero, but also because handlePan is called again with panGestureRecognizer.state equal to .ended) and so UIPercentDrivenInteractiveTransition.cancel() is called twice.

Why that causes the jump I'm experiencing, I haven't a clue.

mgray88 avatar Feb 05 '20 18:02 mgray88

Hmm, is it possible to avoid the duplicate call without removing the line entirely?

benguild avatar Feb 11 '20 06:02 benguild

I'm not really sure what you gain by not removing the line. Like I mentioned, handlePan is still called again with .ended (or maybe .cancelled?), which will still call stopPullToDismiss

mgray88 avatar Feb 11 '20 12:02 mgray88

I also discovered another screen jump bug, which I can't seem to reliably recreate. Hard to describe, but occasionally, when I pull the screen down, but not past the translationThreshold, and release, the screen kind of flashes as the view controller jumps to the top of the screen, without sliding.

I thought it might have something to do with AnimatedTransitioning methods. Did some reading, and it seems UIViewPropertyAnimator is preferred to UIView.animate for interactive transitions. I may see if I can conditionally use UIViewPropertyAnimator and the interruptibleAnimator method for iOS > 10

https://stackoverflow.com/questions/48224242/slowly-panning-in-uipercentdriveninteractivetransition-results-in-glitch The example shown is slightly different than the glitch I experience, but the idea is the same

mgray88 avatar Feb 11 '20 13:02 mgray88

So, first off, thank you very much for contributing. As noted in the update to README.md, I'm actually going to archive the repo at this point. However, I encourage you to maintain your own fork and submit it to Cocoa Pods with credit back to the original repo/pod as a point of reference.

benguild avatar Feb 16 '20 19:02 benguild