Below code works well in iOS 12 or below, but fails to append in iOS 13, as it prints only First Line
and fails to print Extra Text
.
let formattedString = NSMutableAttributedString()
formattedString.append(NSAttributedString(string: "First Line\n" ,
attributes:[NSAttributedStringKey.font:UIFont.systemFont(ofSize: 8.0), NSAttributedStringKey.foregroundColor : UIColor.white]))
formattedString.append(NSAttributedString(string: "Extra Text", attributes: [NSAttributedStringKey.foregroundColor : UIColor.white]))
self.setAttributedTitle(formattedString, for: .normal)