I have a few screens worth of content within my UIScrollView which only scrolls vertically.
I want to programmatically scroll to a view contained somewhere in it\'s
scrollView.scrollRectToVisible(CGRect(x: x, y: y, width: 1, height:
1), animated: true)
or
scrollView.setContentOffset(CGPoint(x: x, y: y), animated: true)
Another way is
scrollView.contentOffset = CGPointMake(x,y);
and i do it with animated like this
[UIView animateWithDuration:2.0f delay:0 options:UIViewAnimationOptionCurveLinear animations:^{
scrollView.contentOffset = CGPointMake(x, y); }
completion:NULL];