Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

store struct not working #28

Open
niskah-media opened this issue Sep 7, 2024 · 1 comment
Open

store struct not working #28

niskah-media opened this issue Sep 7, 2024 · 1 comment

Comments

@niskah-media
Copy link

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))")
         } 
@phimage
Copy link
Owner

phimage commented Sep 7, 2024

hi have you add a breakpoint, see the value returned by object function? (maybe before read the code...)

// PrephirenceType+Codable.swift

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants