// // TrashModel.swift // TrashTrack // // Created by Oliver Hnát on 12.01.2024. // import Foundation import SwiftUI struct Trash { var type: String var color: Color var image: String } struct TrashEvent: Identifiable { var id: Int var trash: Trash var date: Date } struct TrashModel { private (set) var trashTypes: [Trash] private var trashEvents: [TrashEvent] init() { self.trashTypes = [ Trash(type: "plastic", color: .orange, image: "waterbottle"), Trash(type: "paper", color: .blue, image: "newspaper"), Trash(type: "bio", color: .green, image: "tree"), Trash(type: "residual", color: .gray, image: "trash") ] self.trashEvents = [] let numberOfEvents = 10 let start = 1 for i in start.. [TrashEvent] { return self.trashEvents } }