Tutorial by Examples

You 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", s...
To change a label's text font, you need to access its font property: label.font = UIFont(name:"Helvetica Neue", size: 15) The code above will change the font of the label to Helvetica Neue, size 15. Beware that you must spell the font name correctly, otherwise it will throw this error,...

Page 1 of 1