UITextView comes from UIScrollview, so you can set the scroll position using -setContentOffset: animated :.
Assuming you want to smoothly scroll at a speed of 10 points per second, you would do something like this.
- (void) scrollStepAnimated:(NSTimer *)timer { CGFloat scrollingSpeed = 10.0; // 10 points per second NSTimeInterval repeatInterval = [timer timeInterval]; // ideally, something like 1/30 or 1/10 for a smooth animation CGPoint newContentOffset = CGPointMake(self.textView.contentOffset.x, self.textView.contentOffset.y + scrollingSpeed * repeatInterval); [self.textView setContentOffset:newContentOffset animated:YES]; }
Of course, you need to set the timer and don't forget to cancel scrolling when the view disappears, etc.
source share