Here I used the delegate method for UITextView The same thing you can do for UITextField
-In this code, when the user starts to enter values ββin a textview , he makes your look smaller than his original with animation
-When the user finishes entering the values, the size of the original size will be displayed.
-(void)textViewDidBeginEditing:(UITextView *)textView { CGRect frame = self.view.frame; frame.origin.y = -100; [self.view setFrame:frame]; [UIView commitAnimations]; } -(void)textViewDidEndEditing:(UITextView *)textView { CGRect frame = self.view.frame; frame.origin.y = 0; [self.view setFrame:frame]; [UIView commitAnimations]; }
If you want to know about delegates, the link will help you.
source share