diff options
| author | Dustin Mierau <dustin@mierau.me> | 2023-12-16 09:16:15 -0800 |
|---|---|---|
| committer | Dustin Mierau <dustin@mierau.me> | 2023-12-16 09:16:15 -0800 |
| commit | 3e4fbdfcab4a4d2435aed27a16131a6ca26d7408 (patch) | |
| tree | a1aec47c2de30074257dec14e3b2615a8b178033 /Hotline/Models/NewsCategory.swift | |
| parent | a428e3e28fb851cec65ff27f212c19bce08e5369 (diff) | |
Implemented basic news reading support. Various UI tweaks.
Diffstat (limited to 'Hotline/Models/NewsCategory.swift')
| -rw-r--r-- | Hotline/Models/NewsCategory.swift | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/Hotline/Models/NewsCategory.swift b/Hotline/Models/NewsCategory.swift deleted file mode 100644 index 0ba87a7..0000000 --- a/Hotline/Models/NewsCategory.swift +++ /dev/null @@ -1,34 +0,0 @@ -import SwiftUI - -enum NewsCategoryType { - case bundle - case category -} - -@Observable class NewsCategory: Identifiable, Hashable { - let id: UUID = UUID() - - let name: String - let count: UInt16 - let type: NewsCategoryType - - init(hotlineNewsCategory: HotlineNewsCategory) { - self.name = hotlineNewsCategory.name - self.count = hotlineNewsCategory.count - - if hotlineNewsCategory.type == 2 { - self.type = .bundle - } - else { - self.type = .category - } - } - - func hash(into hasher: inout Hasher) { - hasher.combine(self.id) - } - - static func == (lhs: NewsCategory, rhs: NewsCategory) -> Bool { - return lhs.id == rhs.id - } -} |