Reputation: 9072
I have the following code in swift 2
let deviceid = UIDevice.currentDevice().identifierForVendor!.UUIDString
This fails to compile. I tried following suggestions from the auto-fix in xCode and I came up with this.
let deviceid = UIDevice.currentDevice.identifierForVendor!.UUIDString
However it still does not compile. It says value of type 'UUID' has no member UUIDString'
Upvotes: 3
Views: 4332
Reputation: 12890
My advice - for these kind of issues - get straight into a playground
let deviceid = UIDevice.current.identifierForVendor?.uuidString
Upvotes: 7