I created a structure so that my fonts are pre-cached globally:
struct Fonts { static let avenirRegular = UIFont(name: "AvenirNextCondensed-Regular", size: 14.0) }
Using...
xy.font = Fonts.avenirRegular
He tells me that my constant is optional.
The value of the optional type 'UIFont?' does not unfold; you wanted to use '!' or '?'?
Why is this optional? Is it likely that AvenirNextCondensed-Regular
not available on all iOS devices? Help is much appreciated.
source share