Feature/7555 migration part 3

This commit is contained in:
Arnfried Griesert
2026-03-17 13:55:15 +00:00
committed by SDE GitLab
parent 4515ab49e4
commit 585f4a852d
14 changed files with 283 additions and 84 deletions

View File

@@ -9,18 +9,20 @@ import Foundation
import KeychainAccess
/// Extension on Keychain to get/set booleans
#if !S_BUM_APP
extension Keychain {
public func set(_ value: Bool, key: String, ignoringAttributeSynchronizable: Bool = true) throws {
try set(value.description, key: key, ignoringAttributeSynchronizable: ignoringAttributeSynchronizable)
}
public func getBool(_ key: String, ignoringAttributeSynchronizable: Bool = true) throws -> Bool? {
guard let value = try getString(key, ignoringAttributeSynchronizable: ignoringAttributeSynchronizable) else {
return nil
}
guard value == true.description || value == false.description else { return nil }
return value == true.description
}
}
public func set(_ value: Bool, key: String, ignoringAttributeSynchronizable: Bool = true) throws {
try set(value.description, key: key, ignoringAttributeSynchronizable: ignoringAttributeSynchronizable)
}
public func getBool(_ key: String, ignoringAttributeSynchronizable: Bool = true) throws -> Bool? {
guard let value = try getString(key, ignoringAttributeSynchronizable: ignoringAttributeSynchronizable) else {
return nil
}
guard value == true.description || value == false.description else { return nil }
return value == true.description
}
}
#endif