TLLayoutTransitioning icon indicating copy to clipboard operation
TLLayoutTransitioning copied to clipboard

Jarring snap at end of interactive transition.

Open dillan opened this issue 8 years ago • 3 comments

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

dillan avatar Sep 11 '15 17:09 dillan

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.

wtmoose avatar Sep 11 '15 17:09 wtmoose

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.

dillan avatar Sep 11 '15 17:09 dillan

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.

wtmoose avatar Sep 13 '15 16:09 wtmoose