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
For Swift 3, many Foundation types have dropped the 'NS' prefix, so you'd access it by UUID().uuidString.
Foundation
UUID().uuidString