How can I deal with TextField iOS Keychain in Swift?

I saved my account via Locksmith Keychain, everything is working fine, right now I need to parse the data stored in the textField, how can I do this? Here is the code I am using to save my account:

let accountsave = Locksmith.saveData(["account": self.txtAccount.text], forUserAccount: "myUserAccount", inService: "myAccount").

      

At the moment I need to quickly split the datastore into a text field. Please, help

+3


source to share


1 answer


From what I understand about your question, you are asking for something similar to this:



let (dictionary, error) = Locksmith.loadDataForUserAccount("myUserAccount", inService: "myAccount")
if let userData = dictionary as? [String:String] {
    if let account = userData["account"] {
        self.txtAccount.text = account
    }
}

      

0


source







All Articles