so, basically I need to know if there is a way to have a observer o another method that is called when the keyboard is hidden.
The problem i have is that after dismissing the Keyboard, I commit 2 Animations, one to take the view to the original position (since I move up the view so the user can see the textfield while typing) and an Animation Flipping the View but the Flip occurs before the Keyboard is fully hidden so I have a little graphic glitch.
I’ve tried sleep(), and another wait methods without luck.
The Code Basically is this
- (BOOL)textFieldShouldReturn:(UITextField *)textFieldi{
[textFieldi resignFirstResponder];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES];
[self.view exchangeSubviewAtIndex:1 withSubviewAtIndex:0];
CuantoFaltaiOSAppDelegate * del = [CuantoFaltaiOSAppDelegate instance];
del.headerView.frame = CGRectMake(0, 20, del.headerView.frame.size.width, del.headerView.frame.size.height);
[UIView commitAnimations];
return YES;
}
The problem is that the Keyboard isn’t fully Hide and the Flip is perfomed, so i need a way to wait for it.
Register for the
UIKeyboardDidHideNotificationnotification.Example:
Subscribe to the
UIKeyboardDidHideNotificationas follows (put this in yourviewWillAppear:method):This assumes you have a method called
keyboardDidHide:(this is where your animation logic will reside)