How do I scroll to a position programmatically in UIScrollView

Solution 1:

Use the following code:

scrollView.contentOffset = CGPoint(x: 0, y: 0)

Solution 2:

To animate your scrolling do this:

CGRect frame = CGRectMake(0, 768, 1024, 748); //wherever you want to scroll 
[self.scrollView scrollRectToVisible:frame animated:YES];

Solution 3:

Easiest way with animation ->

[scrollView setContentOffset:CGPointMake(0, 0) animated:YES]