mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Save window state to user defaults. Issue #1852
This commit is contained in:
@@ -18,6 +18,7 @@ struct AppDefaults {
|
||||
|
||||
struct Key {
|
||||
static let firstRunDate = "firstRunDate"
|
||||
static let windowState = "windowState"
|
||||
static let lastImageCacheFlushDate = "lastImageCacheFlushDate"
|
||||
static let sidebarFontSize = "sidebarFontSize"
|
||||
static let timelineFontSize = "timelineFontSize"
|
||||
@@ -55,6 +56,15 @@ struct AppDefaults {
|
||||
return true
|
||||
}()
|
||||
|
||||
static var windowState: [AnyHashable : Any]? {
|
||||
get {
|
||||
UserDefaults.standard.object(forKey: Key.windowState) as? [AnyHashable : Any]
|
||||
}
|
||||
set {
|
||||
UserDefaults.standard.set(newValue, forKey: Key.windowState)
|
||||
}
|
||||
}
|
||||
|
||||
static var lastImageCacheFlushDate: Date? {
|
||||
get {
|
||||
return date(for: Key.lastImageCacheFlushDate)
|
||||
|
||||
Reference in New Issue
Block a user