Defined the Todo model in the app target.

This commit is contained in:
2026-02-09 15:40:49 +01:00
parent e6e9afe7fa
commit 7c63e0d8f8
4 changed files with 46 additions and 15 deletions
+3 -3
View File
@@ -7,7 +7,7 @@ struct ContentView: View {
private var modelContext
@Query
private var items: [Item]
private var items: [Todo]
var body: some View {
NavigationSplitView {
@@ -43,7 +43,7 @@ struct ContentView: View {
private func addItem() {
withAnimation {
let newItem = Item(timestamp: Date())
let newItem = Todo(title: "New Todo", due: Date())
modelContext.insert(newItem)
}
}
@@ -59,5 +59,5 @@ struct ContentView: View {
#Preview {
ContentView()
.modelContainer(for: Item.self, inMemory: true)
.modelContainer(for: Todo.self, inMemory: true)
}