iOS UUID (Universally Unique Identifier) Identifier for vendor


Example

iOS 6

Within a single line, we can get an UUID like below:

Swift

let UDIDString = UIDevice.currentDevice().identifierForVendor?.UUIDString

Objective-C

NSString *UDIDString = [[[UIDevice currentDevice] identifierForVendor] UUIDString];

The identifierForVendor is an unique identifier that stays the same for every app of a single vendor on a single device, unless all of the vendor's apps are deleted from this device. See Apple's documentation about when this UUID changes.