I have a UIViewController subclass as a scene in the storyboard that contains a UIScrollView containing various subviews. One of the subviews is a
UIViewController
UIScrollView
Actually, I put that line of code in viewDidDisappear, and so that it remembers the offset when the view reappears, I added this line before it
viewDidDisappear
self.contentOffset = self.scrollView.contentOffset;
as well as
- (void)viewDidLayoutSubviews { self.scrollView.contentOffset = self.contentOffset; }