-
-
Save fitomad/4a38517e25dd838b172d618d6b711cc0 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
// Lo que vamos a añadir al Keychain... | |
let query: [String: Any] = [ | |
kSecClass as String: kSecClassGenericPassword, | |
kSecAttrService as String: self.serviceName, | |
kSecAttrAccount as String: user.name, | |
kSecValueData as String: passwordData | |
] | |
// Operación | |
let status = SecItemAdd(query as CFDictionary, nil) | |
// Comprobamos el resultado | |
if status != errSecSuccess | |
{ | |
throw KeychainError.unknown(status: status) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment