I wish to programatically set the font of a label to system font Bold. I am using the following code to set the font but I do not know how to set it to Bold.
mylabel.font = UIFont.systemFontOfSize(14)
if you want to set the System font you Can go for
label.font = UIFont.boldSystemFont(ofSize: 16.0)
if you want to set the customs font you can use below
label.font = UIFont(name:"FontName-Bold", size: 16.0)
Can use system font
label.font = UIFont.boldSystemFont(ofSize: 14.0)
OR
Font attribute
label.font = UIFont(name:"HelveticaNeue-Bold", size: 14.0)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.