Strikethrough Text Attributed not displaying correctly in UILabel in iOS 10.3

Originator:david
Number:rdar://31691146 Date Originated:4/18/2017
Status:Open Resolved:
Product:iOS SDK Product Version:10.3
Classification:UI/Usability Reproducible:Always
 
Description:

I have come across a few places in iOS 10.3 and iOS 10.3.1 where the strikethrough attribute on an attribute string is not being displayed in a UILabel.

1) If the strikethrough attribute does not span the entire length of the string the strikethrough will not display on the text in UILabel.
2) If the attributed string containing a strikethrough also contains a paragraph style that sets the lineHeightMultiplier, minimumLineHeight, or maximumLineHeight value is set the strikethrough will not display on the text in a UILabel.

All of the above cases worked correctly in iOS 10.2 and before but no longer render the strikethrough as of iOS 10.3.


Steps to reproduce:
Case 1:
1) Create an NSMutableAttributedString with no attributes.
2) Add to that string an attributes dictionary containing an NSUnderlineStyleValue other than .styleNone for the key NSStrikethroughStyleAttributeName for less than the entire range of the string.
3) Set that attributed string on a UILabel

Case 2:
1) Create an NSAttributedString with an attributes dictionary containing an NSUnderlineStyleValue other than .styleNone for the key NSStrikethroughStyleAttributeName and an NSParagraphStyle with a lineHeightMultiple of 1.5.
2) Set that attributed string on a UILabel


Expected Results:
Case 1:
The displayed text should contain a visible strikethrough for the specified range.

Case 2:
The displayed text should contain a visible strikethrough for the entire range.


Actual Results:
There is no visible strikethrough.

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!