swift3 生成UUID
swift3 生成UUID
//获取UUID func getUUID() -> String { let uuidRef = CFUUIDCreate(nil) let uuidStringRef = CFUUIDCreateString(nil,uuidRef) return uuidStringRef! as String }
结果为如下格式:
F4709DFF-24CD-458F-AECB-C0082B87052A
8A860517-F2FA-4B33-B19E-580749DCAC73
32位长度uuid。