ObjectIdentifier
A unique identifier for a class instance or metatype.
@frozen struct ObjectIdentifier
This unique identifier is only valid for comparisons during the lifetime of the instance.
In Swift, only class instances and metatypes have unique identities. There is no notion of identity for structs, enums, functions, or tuples.
Citizens in Swift
Conformances
protocol Comparable
A type that can be compared using the relational operators
<
,<=
,>=
, and>
.protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Sendable
A type whose values can safely be passed across concurrency domains by copying.
Members
init(AnyObject
) Creates an instance that uniquely identifies the given class instance.
init(Any
.Type) Creates an instance that uniquely identifies the given metatype.
var debugDescription: String
A textual representation of the identifier, suitable for debugging.
static func < (ObjectIdentifier, ObjectIdentifier
) -> Bool static func == (ObjectIdentifier, ObjectIdentifier
) -> Bool func hash(into: inout Hasher
) Hashes the essential components of this value by feeding them into the given hasher.
Features
static func != (Self, Self
) -> Bool static func ... (Self
) -> PartialRangeFrom<Self> Returns a partial range extending upward from a lower bound.
static func ... (Self
) -> PartialRangeThrough<Self> Returns a partial range up to, and including, its upper bound.
static func ... (Self, Self
) -> ClosedRange<Self> Returns a closed range that contains both of its bounds.
static func ..< (Self
) -> PartialRangeUpTo<Self> Returns a partial range up to, but not including, its upper bound.
static func ..< (Self, Self
) -> Range<Self> Returns a half-open range that contains its lower bound but not its upper bound.