I have an app in which I render local HTML files in a UIWebView. The files, however, are sometimes large, and getting to where you want takes a long time with the default scroll
Find a subview of UIWebView which is a UIScrollView, then set decelerationRate to UIScrollViewDecelerationRateNormal. This makes the UIWebView as fast as an ordinary UIScrollView.
In iOS 4/5, we can simply use the last subview of UIWebView.
UIScrollView *scroll = [webView.subviews lastObject];
if ([scroll isKindOfClass:[UIScrollView class]]) {
scroll.decelerationRate = UIScrollViewDecelerationRateNormal;
}
The default decelerationRate of UIWebView's UIScrollView is 0.989324, while UIScrollViewDecelerationRateFast is 0.99, and UIScrollViewDecelerationRateNormal is 0.998.
This method doesn't use any private API.