I have tried the below but it has only styles the pipe itself.
I have some text: New Content - Published Today| 10 min read
func makeAttributedText(using baseString: String?) -> NSMutableAttributedString? {
guard let baseString = baseString else { return nil }
let attributedString = NSMutableAttributedString(string: baseString, attributes: nil)
let timeToReadRange = (attributedString.string as NSString).range(of: "|")
attributedString.setAttributes([NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: 18)], range: timeToReadRange)
return attributedString
}
我有一些文字。