Key
struct Key
struct Key
import Foundation
class NSAttributedString
init(attributedString: NSAttributedString)
Returns an NSAttributedString object initialized with the characters and attributes of another given attributed string.
required init?(coder aDecoder: NSCoder)
init(string: String)
Returns an NSAttributedString object initialized with the characters of a given string and no attribute information.
init(string: String, attributes attrs: [NSAttributedString.Key : Any]? = nil)
Returns an NSAttributedString object initialized with a given string and attributes.
static var supportsSecureCoding: Bool { get }
override var description: String { get }
var length: Int { get }
The length of the receiver’s string object.
var string: String { get }
The character contents of the receiver as an NSString object.
func attribute(_ attrName: NSAttributedString.Key, at location: Int, effectiveRange range: NSRangePointer?) -> Any?
Returns the value for an attribute with a given name of the character at a given index, and by reference the range over which the attribute applies.
func attribute(_ attrName: NSAttributedString.Key, at location: Int, longestEffectiveRange range: NSRangePointer?, in rangeLimit: NSRange) -> Any?
Returns the value for the attribute with a given name of the character at a given index, and by reference the range over which the attribute applies.
func attributedSubstring(from range: NSRange) -> NSAttributedString
Returns an NSAttributedString object consisting of the characters and attributes within a given range in the receiver.
func attributes(at location: Int, effectiveRange range: NSRangePointer?) -> [NSAttributedString.Key : Any]
Returns the attributes for the character at a given index.
func attributes(at location: Int, longestEffectiveRange range: NSRangePointer?, in rangeLimit: NSRange) -> [NSAttributedString.Key : Any]
Returns the attributes for the character at a given index, and by reference the range over which the attributes apply.
override func copy() -> Any
func copy(with zone: NSZone? = nil) -> Any
func encode(with aCoder: NSCoder)
func enumerateAttribute(_ attrName: NSAttributedString.Key, in enumerationRange: NSRange, options opts: NSAttributedString.EnumerationOptions = [], using block: (Any?, NSRange, UnsafeMutablePointer<ObjCBool>) -> Void)
Executes the block for the specified attribute run in the specified range.
func enumerateAttributes(in enumerationRange: NSRange, options opts: NSAttributedString.EnumerationOptions = [], using block: ([NSAttributedString.Key : Any], NSRange, UnsafeMutablePointer<ObjCBool>) -> Void)
Executes the block for each attribute in the range.
override func isEqual(_ object: Any?) -> Bool
func isEqual(to other: NSAttributedString) -> Bool
Returns a Boolean value that indicates whether the receiver is equal to another given attributed string.
override func mutableCopy() -> Any
func mutableCopy(with zone: NSZone? = nil) -> Any
struct EnumerationOptions
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol Equatable
A type that can be compared for value equality.
protocol Escapable
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
protocol Sendable
init(_ rawValue: String)
init(rawValue: String)
static let inflectionAlternative: NSAttributedString.Key
static let inflectionRule: NSAttributedString.Key
static let language: NSAttributedString.Key
static let morphology: NSAttributedString.Key
let rawValue: String
var hashValue: Int { get }
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.
func hash(into hasher: inout Hasher)