responder-chain
Is there any way of asking an iOS view which of its children has first responder status? [duplicate]
I really like VJK’s solution, but as MattDiPasquale suggests it seems more complex than necessary. So I wrote this simpler version: Objective-C UIResponder+FirstResponder.h: #import <UIKit/UIKit.h> @interface UIResponder (FirstResponder) +(id)currentFirstResponder; @end UIResponder+FirstResponder.m: #import “UIResponder+FirstResponder.h” static __weak id currentFirstResponder; @implementation UIResponder (FirstResponder) +(id)currentFirstResponder { currentFirstResponder = nil; [[UIApplication sharedApplication] sendAction:@selector(findFirstResponder:) to:nil from:nil forEvent:nil]; return currentFirstResponder; } -(void)findFirstResponder:(id)sender … Read more