-
-
Save fra3il/69cec93f117f7c74ef74 to your computer and use it in GitHub Desktop.
[WP/151] UIKeyboardCandidateBar + Bluetooth Keyboard
This file contains 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
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShow:) name:UIKeyboardDidShowNotification object:nil]; | |
} | |
- (void)findCandidateBar:(NSArray *)subviews { | |
for (UIView *view in subviews) { | |
if ([[view description] hasPrefix:@"<UIKeyboardCandidateBar"]) { | |
_candidateBarHeight = view.frame.size.height; | |
} else { | |
[self findCandidateBar:[view subviews]]; | |
} | |
} | |
} | |
- (void)keyboardDidShow:(NSNotification *)notification { | |
_candidateBarHeight = 0; | |
[self findCandidateBar:[[UIApplication sharedApplication] windows]]; | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment