Since this question was originally asked, UIScrollView deceleration rate customization has been added via the decelerationRate property introduced in OS 3.0.
I found that by using KVC to modify the instance variable _decelerationFactor
allowed me to change the rate to something other than UIScrollViewDecelerationRateNormal
or UIScrollViewDecelerationRateFast
. I subclassed UIScrollView
and wrapped the whole lot in a try block
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
@try {
CGFloat decelerationRate = UIScrollViewDecelerationRateFast +(UIScrollViewDecelerationRateNormal - UIScrollViewDecelerationRateFast) * .52;
[self setValue:[NSValue valueWithCGSize:CGSizeMake(decelerationRate,decelerationRate)] forKey:@"_decelerationFactor"];
}
@catch (NSException *exception) {
// if they modify the way it works under us.
}
}
return self;
}