I have UITextView subviews inside a UITableViewCell. When user taps on the cell I select it, i.e. I switch the background image to selected state. The UITextView becomes first responder, but the cursor is hidden. When I disable the cell selection the UITextView shows a cursor without issues.
How to select the cell and start editing the UITextView with a visible cursor? 🙂
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
if (selected && ![textView isFirstResponder]) {
[textView setUserInteractionEnabled:YES];
[textView becomeFirstResponder];
} else {
[textView resignFirstResponder];
[textView setUserInteractionEnabled:NO];
}
}
Cell stopped to hide cursor, when i set.
But after that, cell also stopped use selectedBackgroundView. So I set my image to highlighted state of backgroundView.
And switched image in setSelected:animated: