yattee/Model/Cache/CacheModel.swift

17 lines
479 B
Swift
Raw Normal View History

2022-11-10 17:11:28 +00:00
import Foundation
2022-12-10 00:23:13 +00:00
import Logging
2022-11-10 17:11:28 +00:00
struct CacheModel {
static var shared = CacheModel()
2022-12-10 00:23:13 +00:00
let logger = Logger(label: "stream.yattee.cache")
static let bookmarksGroup = "group.stream.yattee.app.bookmarks"
let bookmarksDefaults = UserDefaults(suiteName: Self.bookmarksGroup)
2022-11-10 20:46:37 +00:00
func removeAll() {
guard let bookmarksDefaults else { return }
bookmarksDefaults.dictionaryRepresentation().keys.forEach(bookmarksDefaults.removeObject(forKey:))
2022-11-10 20:46:37 +00:00
}
2022-11-10 17:11:28 +00:00
}