0

How can I change the font size of a NSAttributedString that has been initialized with

init(data: Data, options: [NSAttributedString.DocumentReadingOptionKey : Any] = [:], documentAttributes: AutoreleasingUnsafeMutablePointer<NSDictionary?>?)

Actually I have strings that contain html tags, I use the extension given here by Roger Carvalho. The html tags are correctly rendered but the font is not the same as the regular one given by FontSizeMetrics:

let fontMetrics: FontSizeMetrics = FontSizeMetrics()
let font = UIFont(name: "NotoSans", size: fontMetrics.fontRegular)
eqtèöck
  • 971
  • 1
  • 13
  • 27

1 Answers1

0

In Swift 4:

[NSAttributedStringKey.font : UIFont.boldSystemFont(ofSize: 17.0)]

user3377706
  • 13
  • 1
  • 3