Declaring and initializing UIFont
suggest changeYou can declare a UIFont as follows:
var font: UIFont!
UIFont has more init() methods:
UIFont.init(descriptor: UIFontDescriptor, size: CGFloat)UIFont.init(name: String, size: CGFloat)
Therefore, you can initialize a UIFont like this:
let font = UIFont(name: "Helvetica Neue", size: 15)
The default font is System, size 17.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents