Is there a way to italicize only one part of a string in a button?

I want to italicize only one word of a string in a button. Is there a way to do this?
Yes you can.
  • build the attributed String

  • And use the following func:

func setAttributedTitle(NSAttributedString?, for: UIControl.State)
Sets the styled title to use for the specified state.

Is there a way to italicize only one part of a string in a button?
 
 
Q