Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@fra3il

fra3il/0.m Secret

Last active January 27, 2016 02:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fra3il/69cec93f117f7c74ef74 to your computer and use it in GitHub Desktop.
Save fra3il/69cec93f117f7c74ef74 to your computer and use it in GitHub Desktop.
[WP/151] UIKeyboardCandidateBar + Bluetooth Keyboard
- (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