UIFont should be compatible with IBInspectable

Originator:marcelofabri.mf
Number:rdar://33586201 Date Originated:28-Jul-2017 10:19 AM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 9 beta 4
Classification:UI/Usability Reproducible:Always
 
Summary:
This is a duplicate of radar #33583836

Currently if you have a custom control that requires a font be set, and you include it from a storyboard, there is no good way to customize the font using IBInspectables.


Steps to Reproduce:
1. Create a UIView subclass, and add this property:

```
@IBInspectable var font: UIFont!
```

2. Add a view of your class, and attempt to set this property

Expected Results:
You get a font picker for the property just like when you're customizing the font of a UILabel

Actual Results:
This property isn't customizable using interface builder

Version:
Xcode 9 beta 4

Notes:
We're currently working around this by making multiple properties for the font name and the font size, and then, based on the string, building the font in code. This is obviously a lot more overhead and is much more error prone.

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!