UIView-FormScroll

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.

Stars
5

#How to use

  1. Add the .h and .m files to your project.
  2. Import the .h file using: #import "UIView+FormScroll.h"
  3. Example usage for moving a view up and down when a text field becomes active and resigns the first responder:
- (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

Related Projects