Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Codable saving functionality#167

Open
kevin-hv wants to merge 1 commit intojrendel:developfrom
kevin-hv:develop
Open

Codable saving functionality#167
kevin-hv wants to merge 1 commit intojrendel:developfrom
kevin-hv:develop

Conversation

@kevin-hv
Copy link

@kevin-hv kevin-hv commented Mar 28, 2021

Hey! I really missed the functionality of saving objects conforming to the Codable protocol.

This code lives in an extension now in my projects. But I was wondering whether this could get into the main codebase.

Example code:

struct UserInfo : Codable {
    let firstName : String
    let lastName : String
}

KeychainWrapper.standard.set(UserInfo(firstName: "Kevin", lastName: "Varga Halász"), forKey: KeychainWrapper.Key.userInfo.rawValue)

guard let userInfo : UserInfo = KeychainWrapper.standard.codable(forKey: .userInfo) else { return }

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant