-1

in my playground I need to change the font of text in the button, how can I do? This is my code to declare the button in the playground

let button = UIButton(frame: CGRect(x: 0, y: 0, width: 375, height: 133.4))
    button.backgroundColor = UIColor.red
    button.setTitle("Test", for: .normal)
Abhinandan Pratap
  • 2,142
  • 1
  • 18
  • 39
Grazia Bo
  • 15
  • 6

1 Answers1

-1

button.titleLabel?.font = UIFont(name:"Times New Roman", size: 20)

cole
  • 3,147
  • 3
  • 15
  • 28