Find the first responder


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.