UIDevice.currentDevice().identifierForVendor!。UUIString Swift 3迁移
我在swift 2中有以下代码UIDevice.currentDevice().identifierForVendor!。UUIString Swift 3迁移,swift,swift2,swift3,ios10,deviceid,Swift,Swift2,Swift3,Ios10,Deviceid,我在swift 2中有以下代码 let deviceid = UIDevice.currentDevice().identifierForVendor!.UUIDString 这无法编译。我试着按照xCode中自动修复的建议来做,我想到了这个 let deviceid = UIDevice.currentDevice.identifierForVendor!.UUIDString 但是它仍然无法编译。它说类型为“UUID”的值没有成员UUIDString“我的建议-对于此类问题-直接进入游
let deviceid = UIDevice.currentDevice().identifierForVendor!.UUIDString
这无法编译。我试着按照xCode中自动修复的建议来做,我想到了这个
let deviceid = UIDevice.currentDevice.identifierForVendor!.UUIDString
但是它仍然无法编译。它说类型为“UUID”的值没有成员UUIDString“我的建议-对于此类问题-直接进入游戏场
let deviceid = UIDevice.current.identifierForVendor?.uuidString
为什么选择-1?我认为这是一个合理的问题,即使它有一个简单的答案。