Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting UILabel text to bold [duplicate]

Tags:

ios

uilabel

swift

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" 
like image 785
bhzag Avatar asked Jul 29 '14 22:07

bhzag


People also ask

How do I make my text bold on UILabel?

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.


1 Answers

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) 
like image 121
codester Avatar answered Oct 13 '22 15:10

codester