While I used the method "scrollRectToVisible", the value of the property "contentOffset" remained the same although the frames visually were moved in Scroll View. I thought that "contentOffset" reflects how much it is moved/scrolled in Scroll View. Here is my code:
NSLog(@"Offset Before: %f", scrollView.contentOffset.x);
CGRect rectToScroll = CGRectMake(
100,
subview.frame.origin.y,
subview.frame.size.width,
subview.frame.size.height);
[scrollView scrollRectToVisible:rectToScroll animated:YES];
NSLog(@"Offset After: %f", scrollView.contentOffset.x);
"subview" represents UIImageView inside UIScrollView, but for the question it does not matter.