Reputation: 25
Is it possible get to a device's specifications from a UDID? For instance, if it's an iPad or iPhone.
Or are UDIDs just completely random?
Upvotes: 2
Views: 1255
Reputation: 440
You can't get UDID of device, see link
However, You can get some device's specifications (iOS version, model name...) from UIDevice instance:
var myDevice = UIDevice.currentDevice()
About device type (iphone/ipad): with iOS < 8, you can check
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
with iOS>= 8, you can retrieve this info from UITraitCollection, property userInterfaceIdiom
Upvotes: 1