Skip to content

store struct not working #28

Description

@niskah-media

I'm trying to store struct object but not work.

struct InstagramApiUser: Codable {
    var access_token: String
    var user_id: Int
}

storing with:

let json = try JSONDecoder().decode(InstagramApiUser.self, from: data)
KeychainPreferences.sharedInstance[InstagramClient.keychain_api_user_key, .archive] = json

retrieving with:

         if let user = self.keychain.object(forKey: InstagramClient.keychain_api_user_key) as? InstagramApiUser {
             print("- OAuth2 user api: \(String(describing: self.user_api))")
         } 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions