cell!.textLabel?.text = vehicle["vrn"].string
cell?.detailTextLabel?.text = stateString
I want to display stateString
as bold
and also tried to use textLabel
instead of detailedText
but it did not work.
cell!.textLabel?.text = vehicle["vrn"].string
cell?.detailTextLabel?.text = stateString
I want to display stateString
as bold
and also tried to use textLabel
instead of detailedText
but it did not work.
You can set the font property of the detailTextLabel
like so:
cell.detailTextLabel?.font = UIFont.boldSystemFontOfSize(15.0)
You can use the font
property inside the UILabel
class.
// You need to set the name of your font here
cell.detailTextLabel?.font = UIFont(name:"HelveticaNeue-Bold", size: 16.0)
There are other options using the attributedText
property but implies a little more of code, something like this:
// Define attributes to set
let labelFont = UIFont(name: "HelveticaNeue-Bold", size: 16)
let attributes :Dictionary = [NSFontAttributeName : labelFont]
// Create the attributed string
var attrString = NSAttributedString(string: "textOfYourLabel", attributes:attributes)
cell.detailTextLabel?.attributedText = attrString
I hope this help you.
If you want to bold text label using story board, simply select SHADOW colour in attributes inspector to same of that Text colour. Its works for me try it....