aboutsummaryrefslogtreecommitdiff
path: root/Hotline/Models/NewsCategory.swift
diff options
context:
space:
mode:
authorDustin Mierau <dustin@mierau.me>2023-12-16 09:16:15 -0800
committerDustin Mierau <dustin@mierau.me>2023-12-16 09:16:15 -0800
commit3e4fbdfcab4a4d2435aed27a16131a6ca26d7408 (patch)
treea1aec47c2de30074257dec14e3b2615a8b178033 /Hotline/Models/NewsCategory.swift
parenta428e3e28fb851cec65ff27f212c19bce08e5369 (diff)
Implemented basic news reading support. Various UI tweaks.
Diffstat (limited to 'Hotline/Models/NewsCategory.swift')
-rw-r--r--Hotline/Models/NewsCategory.swift34
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
- }
-}