First time I am building iOS application, I got stuck in saving data securely. How to save sensitive data like username and password in keychain
in app I am using UserDefaults
to store and retrieve like below
UserDefaults.standard.set([unameTextfield.text], forKey: "userName")
UserDefaults.standard.set([passwordTextfield.text], forKey: "userPassword")
for retrieving:
let uName = UserDefaults.standard.string(forKey: "userName")
let uPassword = UserDefaults.standard.string(forKey: "userPassword")
but I want to save data securely in Keychain, how to do that?