Skip to content
This repository has been archived by the owner on Feb 17, 2020. It is now read-only.

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

Open
benguild opened this issue Aug 29, 2018 · 5 comments · May be fixed by #9
Open
Labels
bug Something isn't working

Comments

@benguild
Copy link
Owner

No description provided.

@benguild benguild added the bug Something isn't working label Aug 29, 2018
@mgray88
Copy link

mgray88 commented Feb 5, 2020

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 mgray88 linked a pull request Feb 6, 2020 that will close this issue
@benguild
Copy link
Owner Author

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

@mgray88
Copy link

mgray88 commented Feb 11, 2020

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
Copy link

mgray88 commented Feb 11, 2020

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

@benguild
Copy link
Owner Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants