mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 09:02:44 +02:00
Add integer methods
This commit is contained in:
@@ -49,6 +49,10 @@ extension MemoryStore: KeyValueStore {
|
||||
setObject(value, forKey: key)
|
||||
}
|
||||
|
||||
func set(_ value: Int?, forKey key: KeyValueStoreKey) throws {
|
||||
setObject(value, forKey: key)
|
||||
}
|
||||
|
||||
// getters
|
||||
func data(forKey key: KeyValueStoreKey) throws -> Data? {
|
||||
return object(forKey: key) as? Data
|
||||
@@ -62,6 +66,10 @@ extension MemoryStore: KeyValueStore {
|
||||
return object(forKey: key) as? Bool
|
||||
}
|
||||
|
||||
func integer(forKey key: KeyValueStoreKey) throws -> Int? {
|
||||
return object(forKey: key) as? Int
|
||||
}
|
||||
|
||||
// remove
|
||||
func removeObject(forKey key: KeyValueStoreKey) {
|
||||
map.removeValue(forKey: key)
|
||||
|
||||
Reference in New Issue
Block a user