-
-
Save airspeedswift/6c7051b427fa60534c41 to your computer and use it in GitHub Desktop.
This file contains 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
import KeychainAPI | |
let keychain: Keychain = Keychain(service: "com.secondgear.myapp", accessibility: Accessibility.WhenUnlocked) | |
let userAccount = Account(userName: "justinw@me.com", secret: "lovesecretsexgod") | |
keychain.add(userAccount) | |
if let fetchedAccount = keychain.accountFor("justinw@me.com") | |
{ | |
fetchedAccount.secret = "newpassword" | |
keychain.update(fetchedAccount) | |
keychain.remove(fetchedAccount!); | |
} | |
else { | |
// handle failure | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment