Adds history browser view

This commit is contained in:
James Magahern
2023-01-20 17:28:15 -08:00
parent f374f3ebe8
commit 53efb5389e
9 changed files with 177 additions and 2 deletions

View File

@@ -7,15 +7,25 @@
import Foundation
struct HistoryItem: Hashable
struct HistoryItem: Hashable, Identifiable
{
var url: URL
var title: String
var lastVisited: Date
var id: ObjectIdentifier
init(entity: HistoryItemEntity) {
self.url = entity.url ?? URL(string: "about:blank")!
self.lastVisited = entity.lastVisited ?? Date()
self.title = entity.title ?? ""
self.id = entity.id
}
// For testing/previews
public init(url: URL, title: String, lastVisited: Date) {
self.url = url
self.title = title
self.lastVisited = lastVisited
self.id = ObjectIdentifier(NSUUID())
}
}