Post

Replies

Boosts

Views

Activity

Reply to Any way to disable tvOS's fast scrolling?
I know this is old, but I've recently found a reliable way to prevent fast scroll mode. The key I found (with a little help from chat gpt), is to control the velocity of the scroll, adjusting it so that the system never thinks a fast scroll is happening. here's a bit of code I used to do this. The nice thing about this approach is that it doesn't limit any of the other scrolling behavior (long press scroll, etc) if abs(velocity.y) > 0.75 { /// There is a threshold here that tells the system to go into "fast-scroll" mode /// Reduce the target offset by a fraction to control fast scrolling let newTargetY = scrollView.contentOffset.y + (targetContentOffset.pointee.y - scrollView.contentOffset.y) * 0.9 /// Only apply this if we are passed the first row, otherwise allow the natural deceleration if newTargetY > collectionViewLayout.gridCellHeight { targetContentOffset.pointee.y = newTargetY } } }
Jun ’24