init(string:attributes:)
Creates an attributed string with the specified text and attributes.
Declaration
init(string str: String, attributes attrs: [NSAttributedString.Key : Any]? = nil)Parameters
- str:
The text for the new attributed string.
- attrs:
The attributes for the new attributed string. This method applies the attributes to the entire string. For a list of attributes that you can include in this dictionary, see Key.
Discussion
Returns an NSAttributedString object initialized with the characters of str and the attributes of attrs.