Search code examples
iphoneobjective-canimationuiscrollviewsubclassing

Is there a way to change the speed of scrollRectToVisible?


Is there a way to change how quickly scrollRectToVisible animates when scrolling a UIScrollView?


Solution

  • No, not with public methods. The duration is fixed at 0.3 seconds.

    There is a private, undocumented API to change the duration:

    @interface UIScrollView(UIScrollViewInternal)
    -(void)_setContentOffsetAnimationDuration:(NSTimeInterval)duration;
    @end
    

    but as all undocumented API, using this will lead to rejection from AppStore.