Mercurial > public > geoquiz
comparison GeoQuiz/ProfileModalView.swift @ 15:f1967f8cc67b
first iteration of core data
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Wed, 19 Oct 2022 10:04:17 +0200 |
parents | 136928bae534 |
children | 1011e56b7832 |
comparison
equal
deleted
inserted
replaced
14:136928bae534 | 15:f1967f8cc67b |
---|---|
11 struct ProfileModalView: View { | 11 struct ProfileModalView: View { |
12 @ObservedObject var user: User | 12 @ObservedObject var user: User |
13 @ObservedObject var storeKitRC: StoreKitRC | 13 @ObservedObject var storeKitRC: StoreKitRC |
14 | 14 |
15 @Environment(\.dismiss) var dismiss | 15 @Environment(\.dismiss) var dismiss |
16 @Environment(\.managedObjectContext) var moc | |
17 | |
18 @FetchRequest(sortDescriptors: [ | |
19 SortDescriptor(\.date), | |
20 ]) var playedGames: FetchedResults<PlayedGame> | |
16 | 21 |
17 @State private var showingEditModalView = false | 22 @State private var showingEditModalView = false |
18 | 23 |
19 var body: some View { | 24 var body: some View { |
20 NavigationView { | 25 NavigationView { |
61 } header: { | 66 } header: { |
62 Text("Progress") | 67 Text("Progress") |
63 } | 68 } |
64 | 69 |
65 Section { | 70 Section { |
66 ForEach(1..<10) { _ in | 71 ForEach(playedGames) { playedGame in |
67 Text("Hello") | 72 HStack { |
73 Text("\(playedGame.id)") | |
74 Text("\(playedGame.date)") | |
75 } | |
68 } | 76 } |
69 } header: { | 77 } header: { |
70 Text("Recent games") | 78 Text("Recent games") |
71 } | 79 } |
72 } | 80 } |