1

I want to apply "System semibold 13.0" (this is the name of the font in storyboard) onto the header for a tableview cell group. To do that I'm using:

    let header = view as! UITableViewHeaderFooterView
    header.textLabel?.font = UIFont(name: "Futura", size: 38)!
    header.textLabel?.textColor = UIColor.lightGrayColor()

but idk what to put for the name string. I've tried entering "System Semibold" and "Semibold" but both result in an unwrapped optional crash. What do I have to put in the string to make it use "System semibold 13.0"?

Daniel Storm
  • 18,301
  • 9
  • 84
  • 152
Tommy K
  • 1,759
  • 3
  • 28
  • 51

1 Answers1

3

Use .systemFontOfSize which is available in iOS 8.2 and later. For example:

someLabel.font = UIFont.systemFontOfSize(38.0, weight: UIFontWeightSemibold)

UIFont Class Reference

Daniel Storm
  • 18,301
  • 9
  • 84
  • 152