Posted By

arpit on 09/30/10


Tagged

responder


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

bobbym245
Tintenklecks
cnathan


Find the first responder


 / Published in: Objective C
 

  1. - (UIView *)findFirstResonder:(UIView*)root
  2. {
  3. if ([root isFirstResponder])
  4. {
  5. return root;
  6. }
  7.  
  8. for (UIView *subView in root.subviews)
  9. {
  10. UIView *firstResponder = [self findFirstResonder:subView];
  11. if (firstResponder != nil)
  12. {
  13. return firstResponder;
  14. }
  15. }
  16. return nil;
  17. }

Report this snippet  

You need to login to post a comment.