UPCarouselFlowLayout
UPCarouselFlowLayout copied to clipboard
Fix issue #37
scroll not smooth while scroll small space and release your hand quickly
I find it really helpful, thanks!
Thank you! Currently doesn't work on my very first cell for some reason. Works for every other one. Trying to investigate...
Solves some edge cases:
let hasScrollingVelocity = isHorizontal ? (velocity.x != 0) : (velocity.y != 0)
let proposedContentOffsetCenterOrigin: CGFloat
if hasScrollingVelocity {
let velocityDirectionMultiplier: CGFloat = (isHorizontal ? velocity.x : velocity.y) > 0 ? 1 : -1
proposedContentOffsetCenterOrigin = velocityDirectionMultiplier * 10000
} else {
proposedContentOffsetCenterOrigin = (isHorizontal ? proposedContentOffset.x : proposedContentOffset.y) + midSide
}