Last active
August 20, 2019 02:26
-
-
Save philipshen/a8063d5edb6925c2344563926e1c7d72 to your computer and use it in GitHub Desktop.
Keychain Examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let query: [String:Any] = [ | |
kSecClass as String: kSecClassGenericPassword, | |
kSecAttrSynchronizable as String: kCFBooleanTrue, | |
kSecAttrAccount as String: "accountName".data(using: .utf8)!, | |
kSecValueData as String: "data to store".data(using: .utf8)!, | |
] | |
let status: OSStatus = SecItemAdd(addQuery as CFDictionary, nil) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment