EnumerationOptions
struct EnumerationOptions
struct EnumerationOptions
s10Foundation18NSAttributedStringC18EnumerationOptionsV
What are these?3WS4K
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 Key
protocol Equatable
A type that can be compared for value equality.
protocol ExpressibleByArrayLiteral
A type that can be initialized using an array literal.
protocol OptionSet : RawRepresentable, SetAlgebra
A type that presents a mathematical set interface to a bit set.
protocol RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
protocol Sendable
protocol SetAlgebra<Element> : Equatable, ExpressibleByArrayLiteral
A type that provides mathematical set operations.
init(rawValue: UInt)
static let longestEffectiveRangeNotRequired: NSAttributedString.EnumerationOptions
static let reverse: NSAttributedString.EnumerationOptions
let rawValue: UInt
init()
Creates an empty option set.
init<S>(_ sequence: S) where S : Sequence, Self.Element == S.Element
Creates a new set from a finite sequence of items.
init(arrayLiteral: Self.Element...)
Creates a set containing the elements of the given array literal.
var isEmpty: Bool { get }
A Boolean value that indicates whether the set has no elements.
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.
func contains(_ member: Self) -> Bool
Returns a Boolean value that indicates whether a given element is a member of the option set.
mutating func formIntersection(_ other: Self)
Removes all elements of this option set that are not also present in the given set.
mutating func formSymmetricDifference(_ other: Self)
Replaces this set with a new set containing all elements contained in either this set or the given set, but not in both.
mutating func formUnion(_ other: Self)
Inserts the elements of another set into this option set.
@discardableResult mutating func insert(_ newMember: Self.Element) -> (inserted: Bool, memberAfterInsert: Self.Element)
Adds the given element to the option set if it is not already a member.
func intersection(_ other: Self) -> Self
Returns a new option set with only the elements contained in both this set and the given set.
func isDisjoint(with other: Self) -> Bool
Returns a Boolean value that indicates whether the set has no members in common with the given set.
func isStrictSubset(of other: Self) -> Bool
Returns a Boolean value that indicates whether this set is a strict subset of the given set.
func isStrictSuperset(of other: Self) -> Bool
Returns a Boolean value that indicates whether this set is a strict superset of the given set.
func isSubset(of other: Self) -> Bool
Returns a Boolean value that indicates whether the set is a subset of another set.
func isSuperset(of other: Self) -> Bool
Returns a Boolean value that indicates whether the set is a superset of the given set.
@discardableResult mutating func remove(_ member: Self.Element) -> Self.Element?
Removes the given element and all elements subsumed by it.
mutating func subtract(_ other: Self)
Removes the elements of the given set from this set.
func subtracting(_ other: Self) -> Self
Returns a new set containing the elements of this set that do not occur in the given set.
func symmetricDifference(_ other: Self) -> Self
Returns a new option set with the elements contained in this set or in the given set, but not in both.
func union(_ other: Self) -> Self
Returns a new option set of the elements contained in this set, in the given set, or in both.
@discardableResult mutating func update(with newMember: Self.Element) -> Self.Element?
Inserts the given element into the set.