aboutsummaryrefslogtreecommitdiff
path: root/Hotline/Models/NewsArticle.swift
blob: 067d6b6b77d05e19ae6d0536c0399ecde6995482 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import Foundation

struct NewsArticle: Identifiable, Codable {
  var id: UUID = UUID()
  var parentID: UInt32?
  var path: [String]
  var title: String
  var body: String
}

extension NewsArticle: Equatable {
  static func == (lhs: NewsArticle, rhs: NewsArticle) -> Bool {
    return lhs.id == rhs.id && lhs.parentID == rhs.parentID
  }
}

extension NewsArticle: Hashable {
  func hash(into hasher: inout Hasher) {
    hasher.combine(self.id)
  }
}