How do you set the text for a UILabel
to bold in Swift programmatically? My code so far:
var label = UILabel(frame:theFrame) label.text = "Foo"
Write the following text in the label “Bold Regular”Double Click on Bold to select it, and then right click on it to see more options. Select font > Bold from that option. It should do the task.
Use font
property of UILabel
:
label.font = UIFont(name:"HelveticaNeue-Bold", size: 16.0)
or use default system font
to bold text:
label.font = UIFont.boldSystemFont(ofSize: 16.0)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With