Within a single line, we can get an UUID like below:
let UDIDString = UIDevice.currentDevice().identifierForVendor?.UUIDString
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.