All three of these challenges relate to you upgrade project 7, iExpense:
import Foundation
import SwiftData
@Model
class Expense: Identifiable{
var id = UUID()
let name: String
let type: String
let amount: Double
let currencyCode: String
init(name: String, type: String, amount: Double, currencyCode: String) {
self.name = name
self.type = type
self.amount = amount
self.currencyCode = currencyCode
}
}
ExpenseListView를 따로 만들고, 이 뷰의 생성자에 따라 순서나 보이는 Expense를 여과했다. ContentView의 navigation에 Picker를 추가해 정렬 방식이나 필터 방식을 추가할 수 있도록 설정했다.
만들어진 Expense의 인스턴스를 하나씩 삭제할 수 있도록 설정했다.