Skip to content

Instantly share code, notes, and snippets.

@fannheyward
Created July 29, 2011 08:08
Show Gist options
  • Save fannheyward/1113426 to your computer and use it in GitHub Desktop.
Save fannheyward/1113426 to your computer and use it in GitHub Desktop.
Show/hide keyboard
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.35];
if (self.isFlipped) {
[self.textView resignFirstResponder];
self.keyboard.transform = CGAffineTransformMakeRotation(0);
self.showHideButton.transform = CGAffineTransformMakeRotation(0);
} else {
[self.textView becomeFirstResponder];
self.keyboard.transform = CGAffineTransformMakeRotation(M_PI);
self.showHideButton.transform = CGAffineTransformMakeRotation(M_PI);
}
TOGGLE(self.isFlipped);
[UIView commitAnimations];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment