Structure

ObjectIdentifier

A unique identifier for a class instance or metatype.

Declaration

@frozen struct ObjectIdentifier

Overview

In Swift, only class instances and metatypes have unique identities. There is no notion of identity for structs, enums, functions, or tuples.

Topics

Initializers

init(AnyObject)

Creates an instance that uniquely identifies the given class instance.

init(Any.Type)

Creates an instance that uniquely identifies the given metatype.

Instance Properties

var debugDescription: String

A textual representation of the identifier, suitable for debugging.

var hashValue: Int

The hash value.

Beta

Instance Methods

func hash(into: inout Hasher)

Hashes the essential components of this value by feeding them into the given hasher.

Operator Functions

static func != (ObjectIdentifier, ObjectIdentifier) -> Bool

Returns a Boolean value indicating whether two values are not equal.

static func ... (ObjectIdentifier) -> PartialRangeFrom<ObjectIdentifier>

Returns a partial range extending upward from a lower bound.

static func ... (ObjectIdentifier) -> PartialRangeThrough<ObjectIdentifier>

Returns a partial range up to, and including, its upper bound.

static func ..< (ObjectIdentifier) -> PartialRangeUpTo<ObjectIdentifier>

Returns a partial range up to, but not including, its upper bound.

static func ..< (ObjectIdentifier, ObjectIdentifier) -> Range<ObjectIdentifier>

Returns a half-open range that contains its lower bound but not its upper bound.

static func < (ObjectIdentifier, ObjectIdentifier) -> Bool

Returns a Boolean value indicating whether the value of the first argument is less than that of the second argument.

static func <= (ObjectIdentifier, ObjectIdentifier) -> Bool

Returns a Boolean value indicating whether the value of the first argument is less than or equal to that of the second argument.

static func == (ObjectIdentifier, ObjectIdentifier) -> Bool

Returns a Boolean value indicating whether two values are equal.

static func > (ObjectIdentifier, ObjectIdentifier) -> Bool

Returns a Boolean value indicating whether the value of the first argument is greater than that of the second argument.

static func >= (ObjectIdentifier, ObjectIdentifier) -> Bool

Returns a Boolean value indicating whether the value of the first argument is greater than or equal to that of the second argument.

See Also

Querying Runtime Values

struct Mirror

A representation of the substructure and display style of an instance of any type.

func type<T, Metatype>(of: T) -> Metatype

Returns the dynamic type of a value.

func == (Any.Type?, Any.Type?) -> Bool

Returns a Boolean value indicating whether two types are identical.

func != (Any.Type?, Any.Type?) -> Bool

Returns a Boolean value indicating whether two types are not identical.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software