let myString = text1 + " (\(text2) people added)" let myAttribute = [ NSAttributedStringKey.foregroundColor: UIColor.blue ] let myAttrString = NSAttributedString(string: myString, attributes: myAttribute) cell.textLabel?.attributedText = myAttrString How can I use different styles of text1 and " (\(text2) people added)" in one attributed string?
NSAttributedStringusing the mutable versionNSMutableAttributedString.