In my iOS Swift app I want to generate random UUID (GUID) strings for use as a table key, and this snippet appears to work:
let uuid = CFUU
You could also just use the NSUUID API:
let uuid = NSUUID()
If you want to get the string value back out, you can use uuid.UUIDString.
uuid.UUIDString
Note that NSUUID is available from iOS 6 and up.
NSUUID