UIView category that scrolls a view up or down. Useful for moving a view when you show a keyboard so that the view isn't covered up.
#How to use
.h
and .m
files to your project..h
file using: #import "UIView+FormScroll.h"
- (void)textFieldDidBeginEditing:(UITextField *)textField
{
[self.view scrollToView:textField];
}
-(void) textFieldDidEndEditing:(UITextField *)textField
{
[self.view scrollToY:0];
[textField resignFirstResponder];
}
#Credits
Originally posted to StackOverflow.com by Dan Ray.
Improvements by Mark Rickert
#License
Public Domain