Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jarring snap at end of interactive transition. #25

Open
dillan opened this issue Sep 11, 2015 · 3 comments
Open

Jarring snap at end of interactive transition. #25

dillan opened this issue Sep 11, 2015 · 3 comments

Comments

@dillan
Copy link
Contributor

dillan commented Sep 11, 2015

I've noticed a jarring snap to an unintended position when the user lifts their fingers, ending the pinch gesture. After the layout snaps to the unintended position it will animate back to the expected layout.

interactive_transition_snap

@wtmoose
Copy link
Member

wtmoose commented Sep 11, 2015

Yeah, I've seen that too. Wondering if its due to something changing in iOS9. I'll take a look when I get some time. Please let me know if you see this issue outside of the sample app.

@dillan
Copy link
Contributor Author

dillan commented Sep 11, 2015

I've seen it in an app I'm working on that uses TLLayoutTransitioning. I see similar behavior between iOS 8 and iOS 9. I'm doing a little experimentation to see if I can zero in on the source of the issue. If you have any suggestions for things to check I'd be happy to take a look and contribute any changes.

@wtmoose
Copy link
Member

wtmoose commented Sep 13, 2015

I took an initial look at this and found that the problem is due to a misunderstanding of how the collection view finishes a transition. TLLayoutTransitioning was built under the assumption that progress values are always within [0, 1]. However, after taking a close look, it is clear that

[self.collectionView finishInteractiveTransition]

can temporarily overshoot 1, apparently taking velocity into account. The problem arises because TLLayoutTransitioning's truncates progress values to [0, 1], resulting in various discontinuities.

I've started the work to remove the truncation, but there are some subtle details in TLTransitionLayout's interpolation logic that need to be reworked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants