Created
August 7, 2021 11:41
-
-
Save ykpoh/b9c1229a1f938dda0973b620211dea9a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import KeychainAccess | |
class KeychainHelper { | |
let service = "QKLSKFNAE1.com.example.yungkien.com.shared" | |
let accessGroup = "group.com.example.yungkien.com.shared" | |
func save(_ key: String, _ value: String) throws { | |
let keychain = Keychain(service: service, accessGroup: accessGroup) | |
try keychain.set(value, key: key.rawValue) | |
} | |
func load(key: String) throws -> String? { | |
let keychain = Keychain(service: service, accessGroup: accessGroup) | |
return try keychain.getString(key.rawValue) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment