UITextView phone number detection does not work with certain characters before phone number

Number:rdar://32136365 Date Originated:11-May-2017 10:54 AM
Status:Open Resolved:
Product:iOS + SDK Product Version:iOS 10.3.1
Classification:UIKit Reproducible:Yes

Using a UITextView with data detectors set to phone number and editable set to false, the phone number is not detected with certain character combinations before the phone number.


Doesn't work: "confirmation, call 555-666-7777"
Doesn't work: "confirmation call 555-666-7777"
Works: "confirmation. call 555-666-7777"
Works: "confirmations, call 555-666-7777"

Steps to Reproduce:
1. Use a UITextView that has data detectors set to phone numbers and editable set to false.
2. The text in the text view is set to "confirmation, call 555-666-7777"
3. Run the app.

Expected Results:
The phone number should be a selectable link regardless of the words/characters before the phone number.

Actual Results:
The phone number does not show up as a selectable link.

iOS 10.3.1


iPhone 6s, iOS 10.3.1, Xcode 8.3.2


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!