[Widgets]: Added notes on persistence to reduce memory footprint since we can't have eviction strategy

This commit is contained in:
Magesh K
2025-01-11 21:36:52 +05:30
parent ba825d4218
commit 6ed5acdb40

View File

@@ -22,12 +22,15 @@ class PageInfoManager {
func setPageInfo(forWidgetKind kind: String, forWidgetID id: Int, value: NavigationEvent?) { func setPageInfo(forWidgetKind kind: String, forWidgetID id: Int, value: NavigationEvent?) {
let key = getKey(forWidgetKind: kind, forWidgetID: id) let key = getKey(forWidgetKind: kind, forWidgetID: id)
// UserDefaults.standard.set(value, forKey: key)
pageInfoMap[key] = value pageInfoMap[key] = value
} }
func getPageInfo(forWidgetKind kind: String, forWidgetID id: Int) -> NavigationEvent? { func getPageInfo(forWidgetKind kind: String, forWidgetID id: Int) -> NavigationEvent? {
let key = getKey(forWidgetKind: kind, forWidgetID: id) let key = getKey(forWidgetKind: kind, forWidgetID: id)
// return UserDefaults.standard.value(forKey: key)
return pageInfoMap[key] return pageInfoMap[key]
} }
func popPageInfo(forWidgetKind kind: String, forWidgetID id: Int) -> NavigationEvent? { func popPageInfo(forWidgetKind kind: String, forWidgetID id: Int) -> NavigationEvent? {