This is what I'm trying to achieve:
I want a UITextField
that is in UITableViewCell
to become first responder only when the cell touched. I would like the text field to become the first responder only when I set it to first responder in the method:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath`
Any idea how I can achieve this? When the textfield is touched directly, tableView:didSelectRowAtIndexPath:
is never called.
Thanks in advance.
I guess, u have a custom UITableViewCell. In that u could have a UITextField member. Right?
In the custom cell class, override the method,
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
:
In that , if selected == YES, then make the text field as first responder. Else , resign the first responder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With