Feature Request: Support Customizing UIScrollView's Deceleration Rate
rogerluan opened this issue ยท 2 comments
Hey there! ๐ Posting my first feature request here, at the risk of being too nit-picky ๐
One of the factors that differentiate web pages from native UIScrollView
s is its deceleration rate and how the scroll view responds to touches in general. I don't know the technical details under the hood of Apple's web views, but this is one of the reasons Safari "feels" like a web page and apps' scroll views "feel" native. Some debugging, investigation and research is required. This change is almost imperceptible but if you play with both of them side by side you'll be able to notice the difference.
Docs: https://developer.apple.com/documentation/uikit/uiscrollview/1619438-decelerationrate
@rogerluan very interesting! Thanks for bringing this up. I'll see what I can do
So, right now you can customize the decelerationRate
property manually:
let articleVC = TelegraphViewController(url: url)
articleVC.webView.scrollView.decelerationRate = ...
So you can in fact customize it to fit your needs! I did some very surface-level debugging tho and it seems like the actual value is the same as for any other UIScrollView
(0.998). But feel free to play around with it!