yattee/Model/TrendingCategory.swift

32 lines
695 B
Swift
Raw Normal View History

import Defaults
2022-09-04 15:28:30 +00:00
import Foundation
enum TrendingCategory: String, CaseIterable, Identifiable, Defaults.Serializable {
2021-06-17 10:02:39 +00:00
case `default`, music, gaming, movies
2021-11-01 21:56:18 +00:00
var id: RawValue {
2021-06-17 10:02:39 +00:00
rawValue
}
2021-11-01 21:56:18 +00:00
var title: RawValue {
2022-09-04 15:28:30 +00:00
switch self {
case .default:
return "All".localized()
case .music:
return "Music".localized()
case .gaming:
return "Gaming".localized()
case .movies:
return "Movies".localized()
}
2021-06-17 10:02:39 +00:00
}
2021-11-01 21:56:18 +00:00
var name: String {
2022-09-04 15:28:30 +00:00
id == "default" ? "Trending".localized() : title
2021-11-01 21:56:18 +00:00
}
var controlLabel: String {
2022-09-04 15:28:30 +00:00
id == "default" ? "All".localized() : title
2021-11-01 21:56:18 +00:00
}
2021-06-17 10:02:39 +00:00
}