Declaring and initializing UIFont
suggest changeYou can declare a UIFont as follows:
var font: UIFont!
UIFont also has these initializers:
UIFont(descriptor: UIFontDescriptor, size: CGFloat)UIFont(name: String, size: CGFloat)
UIFont(name:size:) returns nil when that font is not installed:
let font = UIFont(name: "Helvetica Neue", size: 15)
Many controls, such as a UILabel, default to the system font at 17 points. A size of 0 in UIFont(descriptor:size:) means “use the size stored in the descriptor.”
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents