My code not working with NSRange location on iOS13, on iOS12 and below it's work. Is there a way to color the text from the letters to be colored until the total letters afterwards? because I only have data starting from the colored letters and the total letters afterwards.
override func viewDidLoad() {
super.viewDidLoad()
let text = "Testing Attributed Strings"
let attributedString = NSMutableAttributedString(string: text)
let dataStartIHave = 0
let dataTotalIHave = 7
attributedString.addAttribute(.foregroundColor, value: UIColor.red, range: NSRange(location: dataStartIHave, length: dataTotalIHave))
attributedLabel.attributedText = attributedString
}
Thanks in advance.