I would like to get the view that is the first responder, currently I have a UITableView that contains UITextFields, using a method:
-(UIView*) findFirstResponder
{
}
I would like to be able to get the view that is the firstResponder and then do something with that view.
Any ideas?
All I had to do was
@implementation UIView (FindViewThatIsFirstResponder)
- (UIView *)findViewThatIsFirstResponder
{
if (self.isFirstResponder) {
return self;
}
for (UIView *subView in self.subviews) {
UIView *firstResponder = [subView findViewThatIsFirstResponder];
if (firstResponder != nil) {
return firstResponder;
}
}
return nil;
}
@end