Changing the font of a label

suggest change

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, because the initialized value above is an Optional, and thus can be nil:

Unexpectedly found nil while unwrapping an Optional value

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents