Reputation: 843
I have a custom tableviewcell with a label and a textfield. Right now I get callback in method didSelectRowAtIndexpath only when user clicks on cell outside of my textfield. When I touch on textfield this method is not called. So what should I do to get that method called when user touches on the textfield.
Upvotes: 1
Views: 994
Reputation: 1891
You want to read into UITextFieldDelegate and more specifically
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
and
- (void)textFieldDidBeginEditing:(UITextField *)textField
when those get called you can then do this on your UITableView
– selectRowAtIndexPath:animated:scrollPosition:
Upvotes: 2
Reputation: 1631
In cellForRowAtIndexPath method write
cell2.selectionStyle=UITableViewCellSelectionStyleNone;
for that row only
Upvotes: 1