Last active
November 21, 2017 20:29
-
-
Save akultomar17/adff54e1231bbd8a3dd266d1b72cfa34 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
fileprivate func saveAccountDetailsToKeychain(account: String, password: String) { | |
guard account.isEmpty, password.isEmpty else { return } | |
UserDefaults.standard.set(account, forKey: "lastAccessedUserName") | |
let passwordItem = KeychainPasswordItem(service: KeychainConfiguration.serviceName, account: account, accessGroup: KeychainConfiguration.accessGroup) | |
do { | |
try passwordItem.savePassword(password) | |
} catch { | |
print("Error saving password") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment