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

html - jquery - p element wont show after I hid it -

python - BeautifulSoup: How to get the nearest tag -

php - Return Last Insert ID with PDO -