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

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -