NSAttributedString
class NSAttributedString
A string object that contains style attributes associated to portions of its text.
-
The attributed strings text.
Declaration
var string: String { get } -
The number of characters in a string.
Declaration
var length: Double { get } -
A list of attribute runs which are applied to
string.Declaration
var runs: Array { get } -
The number of lines in
string.Declaration
var lineCount: Double { get } -
The object’s description
Declaration
var description: String { get } -
Compares two values for equality.
The
equalsfunction is invoked using infix notation as in the following code snippet:lhs == rhs.Declaration
func equals(_ lhs: NSAttributedString) -> BoolParameters
lhsA value.
rhsAnother value.
Return Value
trueif thelhsandrhsare equal,falseotherwise. -
Seperates the string into components using the specified seperator. For example, “1,2,3”.components(separatedBy: “,”) yields [“1”, “2”, “3”]
Declaration
func components(seperatedBy seperator: String) -> ArrayParameters
seperatorThe seperator used seperate the string into components.
Return Value
An array of strings containing the components of the original string.