Generate a UUID on iOS from Swift -
in ios swift app want generate random uuid (guid) strings use table key, , snippet appears work:
let uuid = cfuuidcreatestring(nil, cfuuidcreate(nil))
is safe?
or there perhaps better (recommended) approach?
try one:
let uuid = nsuuid().uuidstring print(uuid)
swift 3
let uuid = uuid().uuidstring print(uuid)
Comments
Post a Comment