I\'m making an iOS app that has a UITextView. When closing a parenthesis in that UITextView, I want to highlight to the user which opening parenthesis it pairs to. So far I\
There's a much easier way to do this, which you can see in this answer: Animate text change in UILabel.
You just have to set the label.attributedText
property instead:
UIView.transition(
with: label,
duration: 0.15,
options: .transitionCrossDissolve,
animations: {
label.attributedText = NSAttributedString(string: text, attributes: attributes)
},
completion: nil
)