Author Topic: How do I generate a UUID (Universally Unique Identifier)?  (Read 1745 times)

kjmcneish

  • Administrator
  • *****
  • Posts: 719
    • View Profile
How do I generate a UUID (Universally Unique Identifier)?
« on: May 25, 2014, 04:39:15 PM »
The easiest way to generate a UUID is:

Swift:
Code: [Select]
let uuid = NSUUID().UUIDString
Objective-C:
Code: [Select]
NSString *uuid = [[NSUUID UUID] UUIDString];
All the best!
Kevin
Author of "Learn to Code in Swift": https://itunes.apple.com/us/book/learn-to-code-in-swift/id942956811?mt=11
« Last Edit: July 18, 2015, 06:30:10 PM by kjmcneish »