yattee/Model/TrendingCategory.swift

22 lines
406 B
Swift
Raw Normal View History

import Defaults
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 {
2021-06-17 10:02:39 +00:00
rawValue.capitalized
}
2021-11-01 21:56:18 +00:00
var name: String {
id == "default" ? "Trending" : title
}
var controlLabel: String {
id == "default" ? "All" : title
}
2021-06-17 10:02:39 +00:00
}