Setting a UIFont with pointSize 0 breaks UITextField without warning

Originator:oscar
Number:rdar://47280551 Date Originated:15-Jan-2019 05:14 AM
Status:Open Resolved:
Product:iOS + SDK Product Version:12.1
Classification:UI/Usability Reproducible:Always
 
Summary:
We have a setup where we dynamically allow the UITextField to change its font’s point size. 

In the case that somehow a UIFont with pointSize 0 is assigned to a UITextField’s font property, the UITextField completely breaks: its cursor becomes a “dot”, and typing will make the control appear that it’s behaving erratically.

It appears that setting a UIFont with pointSize 0 is undefined for UITextField. I think in these cases, there should be a warning about this.

Steps to Reproduce:
1. Instantiate a UITextField
2. Set its font property to a UIFont object with pointSize 0
3. Try to interact with the text field.

Expected Results:
There’s either a warning indicating that the text field’s behavior with a font of size 0.

Actual Results:
No warning is issued and the text field behaves erratically when interacting with it.

Version:
12.1

Notes:

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!