Scaled UIFont + UIKit Controls Bug

Originator:rod.brown
Number:rdar://36243585 Date Originated:December 31 2017, 7:41 PM
Status:Duplicate of 34919548 Resolved:
Product:UIKit Product Version:iOS 11.2.1
Classification:Bug Reproducible:Always
 
Summary:
When setting a font on a UILabel/UITextField, it does not update if you change from a standard font to a font scaled with UIFontMetrics when the font is otherwise identical, when the preferredContentSizeCategory is large (the default).

Steps to Reproduce:
- Create a UILabel, UITextField, or UITextView
- Set a standard font (eg UIFont.systemFont(ofSize: 12.0))
- Set adjustsFontForContentSizeCategory = true
- Set an adjusted font of the otherwise same type constructed with UIFontMetrics:
    (i.e. UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 12.0)))
- Run the app on device or simulator in the default content size category.
- Live adjust the content size category with control centre or Accessibility Inspector.

Expected Results:
The font should live adjust as it has been changed to a scaled font.

Actual Results:
It does not live adapt. If you start in a non-standard content size category, the bug is not present.

This appears to be because the font returns that it is equal to the scaled font with `isEqual:`, despite the fact one is scalable and one is not, and therefore the font doesn't change.

Version/Build:
iOS 11.2.1 (15C153)

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!