Generate UUID and save to KeyChain.
pod 'TAKUUID'
or
pod 'TAKUUID', :git => 'https://github.com/taka0125/TAKUUID.git'
github "taka0125/TAKUUID"
- "Keychain Sharing" on
First of all, set keychain access group.
Then call findOrCreate
.
- Objective-C
[TAKUUIDStorage sharedInstance].accessGroup = @"12ABCD3E4F.shared";
- Swift
TAKUUIDStorage.sharedInstance().accessGroup = "12ABCD3E4F.shared"
after set keychain access group, call migrate
method.
- Objective-C
[[TAKUUIDStorage sharedInstance] migrate];
- Swift
TAKUUIDStorage.sharedInstance().migrate()
If UUID already created, return it. If not creating UUID yet, create and return it.
- Objective-C
NSString *UUID = [[TAKUUIDStorage sharedInstance] findOrCreate];
- Swift
let UUID = TAKUUIDStorage.sharedInstance().findOrCreate()
renew UUID.
- Objective-C
NSString *UUID = [[TAKUUIDStorage sharedInstance] renew];
- Swift
let UUID = TAKUUIDStorage.sharedInstance().renew()
remove UUID from Keychain.
- Objective-C
BOOL isSuccess = [[TAKUUIDStorage sharedInstance] remove];
- Swift
let isSuccess = TAKUUIDStorage.sharedInstance().remove()
get last error.
- Objective-C
OSStatus status = [TAKUUIDStorage sharedInstance].lastErrorStatus;
- Swift
let status = TAKUUIDStorage.sharedInstance().lastErrorStatus
$ macerror CODE