Skip to content

Instantly share code, notes, and snippets.

@nekonora
Created March 3, 2019 09:47
Show Gist options
  • Save nekonora/e593d0b0a3aeb8c81fe4f81fb927ebc6 to your computer and use it in GitHub Desktop.
Save nekonora/e593d0b0a3aeb8c81fe4f81fb927ebc6 to your computer and use it in GitHub Desktop.
let attributedText = NSMutableAttributedString(
string: "First string",
attributes: [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 14, weight: .semibold)])
attributedText.append(NSAttributedString(
string: "Bold string",
attributes: [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 14, weight: .heavy)]))
attributedText.append(NSAttributedString(
string: "Last string.",
attributes: [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 14, weight: .semibold)]))
myLabel.attributedText = attributedText
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment