I have only a label in the center of one view. I want to bold some part of my label. I can do it, but when I do it, I lose the size of my label. I found some thread, but no one could help me with this problem size.
Here is the code I use:
override func viewDidAppear(_ animated: Bool) {
let attrStr = try! NSAttributedString(
data: "I'm a normal text and <b>this is my bold part . </b>And I'm again in the normal text".data(using: String.Encoding.unicode, allowLossyConversion: true)!,
options: [ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType],
documentAttributes: nil)
myLabel.attributedText = attrStr
}