Advertisement
Guest User

Untitled

a guest
May 24th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. - (void)viewDidLoad {
  2. [super viewDidLoad];
  3.  
  4. [[NSNotificationCenter defaultCenter] addObserver:self
  5. selector:@selector(keyboardDidShow:)
  6. name:UIKeyboardDidShowNotification
  7. object:nil];
  8. }
  9.  
  10. - (void)findCandidateBar:(NSArray *)subviews {
  11. for (UIView *view in subviews) {
  12. if ([[view description] hasPrefix:@"<UIKeyboardCandidateBar"]) {
  13. _candidateBarHeight = view.frame.size.height;
  14. } else {
  15. [self findCandidateBar:[view subviews]];
  16. }
  17. }
  18. }
  19.  
  20. - (void)keyboardDidShow:(NSNotification *)notification {
  21. _candidateBarHeight = 0;
  22. [self findCandidateBar:[[UIApplication sharedApplication] windows]];
  23.  
  24. // ...
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement