import Defaults enum ListingLayout: String, CaseIterable, Identifiable, Defaults.Serializable { case list, cells var id: String { rawValue } var name: String { switch self { case .list: return "List" case .cells: return "Cells" } } } extension Defaults.Keys { #if os(tvOS) static let layout = Key("listingLayout", default: .cells) #endif static let searchQuery = Key("searchQuery", default: "") static let searchSortOrder = Key("searchSortOrder", default: .relevance) static let searchDate = Key("searchDate") static let searchDuration = Key("searchDuration") static let selectedPlaylistID = Key("selectedPlaylistID") static let showingAddToPlaylist = Key("showingAddToPlaylist", default: false) static let videoIDToAddToPlaylist = Key("videoIDToAddToPlaylist") }