Created
September 15, 2014 18:32
-
-
Save justin/f8c0a153aa7d7c9595ee 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: "[email protected]", secret: "lovesecretsexgod") | |
keychain.add(userAccount) | |
let fetchedAccount:Account? = keychain.accountFor("[email protected]") | |
if (fetchedAccount != nil) | |
{ | |
fetchedAccount?.secret = "newpassword" | |
keychain.update(fetchedAccount!) | |
} | |
keychain.remove(fetchedAccount!); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment