A universally unique value that can be used to identify types, interfaces, and other items.
SDKs
- iOS 6.0+
- macOS 10.8+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Xcode 8.0+
Framework
- Foundation
Declaration
struct UUID
A universally unique value that can be used to identify types, interfaces, and other items.
SDKs
Framework
struct UUID
init()
Initializes a new UUID with RFC 4122 version 4 random bytes.
init(uuid: uuid _t)
Create a UUID from a uuid
.
var uuid: uuid _t
Returns the UUID as bytes.
var uuid String: String
Returns a string created from the UUID, such as “E621E1F8-C36C-495A-93FC-0C247A3E6E5F”
static func != (UUID, UUID) -> Bool
Returns a Boolean value indicating whether two values are not equal.
static func == (UUID, UUID) -> Bool
Indicates whether two UUIDs are the same.
var description: String
A textual description of the UUID.
var debug Description: String
A textual description of the UUID suitable for debugging.
var custom Mirror: Mirror
A mirror that reflects the UUID.
var hash Value: Int
The computed hash value of the UUID.
class NSUUID
An object representing a universally unique value that bridges to UUID
; use NSUUID
when you need reference semantics or other Foundation-specific behavior.
typealias UUID .Reference Type
An alias for this value type's equivalent reference type.