I could not find the source For scrolling and holding the position of scrollview here is the code.
For the view where you want to set the scrollview and hold do like this ..
Viewcontroller.h
@property (weak, nonatomic) IBOutlet UIScrollView *scrollView;//from interface builder
@property (weak, nonatomic) IBOutlet UIView *contentView;//from interface
Finally the interface hierarchy should be like this
view-->scrollView-->contentView-->view Contents
viewController.m
-(void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews];
[self.scrollView layoutIfNeeded];
self.scrollView.contentSize = self.contentView.bounds.size;
}
//To dismiss the scrollView when return key pressed ..you can place this code anywhere where you want
}
For more info check this..http://spin.atomicobject.com/2014/03/05/uiscrollview-autolayout-ios/
I hope this helps someone..