mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
feat: added feature to set keyboard shortcut to open/close popup window (#1976)
This commit is contained in:
@@ -37,6 +37,10 @@ public class Store {
|
||||
return (!self.exist(key: key) ? value : defaults.integer(forKey: key))
|
||||
}
|
||||
|
||||
public func array(key: String, defaultValue value: [Any]) -> [Any] {
|
||||
return (!self.exist(key: key) ? value : defaults.array(forKey: key)!)
|
||||
}
|
||||
|
||||
public func data(key: String) -> Data? {
|
||||
return defaults.data(forKey: key)
|
||||
}
|
||||
@@ -57,6 +61,10 @@ public class Store {
|
||||
self.defaults.set(value, forKey: key)
|
||||
}
|
||||
|
||||
public func set(key: String, value: [Any]) {
|
||||
self.defaults.set(value, forKey: key)
|
||||
}
|
||||
|
||||
public func reset() {
|
||||
self.defaults.dictionaryRepresentation().keys.forEach { key in
|
||||
self.defaults.removeObject(forKey: key)
|
||||
|
||||
Reference in New Issue
Block a user