Links to tappable in a UITextView embedded in a UITableViewCell until the selection is cleared

Originator:avedesk
Number:rdar://26342551 Date Originated:18-May-2016 12:59 PM
Status:Open Resolved:
Product:iOS SDK Product Version:9.3.2
Classification:Other Bug Reproducible:Always
 
Summary:
When embedding a UITextView with links (via attributedText) into a UITableViewCell, tap&holding on the links invokes the selection gestures, instead of invoking an action on the link. Fiddling into UIKit, it seemed that this is caused by the UITextView thinking there is a selection (checking the private property textView.selectionView.selection.selectedRange == (83, 0)F). 

After clearing the selection by tapping on an empty space, textView.selectionView.selection.selectedRange == nil, and the action on the link is invoked.

Steps to Reproduce:
1. Create a UITextView with editable = NO
2. set attributedText to some attributedText with embedded links
3. add the UITextView into a UITableViewCell
4. display the cell
5. Tap & hold on a link in the UITextView

Expected Results:
1. The link action is invoked (either the action sheet or the link is opened)

Actual Results:
1. The text selection UI comes up

Regression:

Notes:
Tapping on an empty space in the UITextView a couple of times seems to make links work again.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!