Created
June 18, 2009 20:12
-
-
Save probablycorey/132163 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (id)init { | |
| self = [super initWithNibName:@"BankView" bundle:nil]; | |
| if (!self) return self; | |
| [[NSNotificationCenter defaultCenter] addObserver:self | |
| selector:@selector(keyboardWillShow:) | |
| name:UIKeyboardWillShowNotification | |
| object:self.view.window]; | |
| [[NSNotificationCenter defaultCenter] addObserver:self | |
| selector:@selector(keyboardWillHide:) | |
| name:UIKeyboardWillHideNotification | |
| object:self.view.window]; | |
| return self; | |
| } | |
| - (void)keyboardWillShow:(NSNotification *)notification { | |
| [self.view focusSubview:_textField withPadding:10 forNotification:notification]; | |
| } | |
| - (void)keyboardWillHide:(NSNotification *)notification { | |
| [self.view revertFocusForNotification:notification]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment