-2

How can I change the default font for UISegmentControl title?in Storyboard or Programmatically

  • 1
    Welcome to StackOverflow. Please consider referring to the documentation provided by Apple before asking a question. https://developer.apple.com/documentation/uikit/uisegmentedcontrol UISegmentedControl offers a method called `setTitleTextAttributes` to do that. – JanMensch May 25 '22 at 08:47

1 Answers1

0

1/ Put an IBOutlet

@IBOutlet weak var segment: UISegmentControl!

2/ Custom

segment.setTitleTextAttributes([ NSFontAttributeName: UIFont(name: "YourFont", size: 18.0)! ], forState: .Normal)
Q.u.a.n.g L.
  • 1,564
  • 1
  • 12
  • 27