Allow setting a nil value in AppKeychain.add to delete existing content
This commit is contained in:
parent
fa2fde1af4
commit
cc493cb490
2 changed files with 6 additions and 12 deletions
|
|
@ -14,11 +14,11 @@ public class AppKeychain {
|
|||
.accessibility(.whenUnlockedThisDeviceOnly)
|
||||
.synchronizable(false)
|
||||
|
||||
public static func add(data: Data, for key: String) {
|
||||
public static func add(data: Data?, for key: String) {
|
||||
keychain[data: key] = data
|
||||
}
|
||||
|
||||
public static func add(string: String, for key: String) {
|
||||
public static func add(string: String?, for key: String) {
|
||||
keychain[key] = string
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue