Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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)
let fetchedAccount:Account? = keychain.accountFor("justinw@me.com")
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
You can’t perform that action at this time.