I have the same question. It looks like using SwiftData could simplify the storage and retrieval of structured data. For example,
struct Gamestats {
var played: Int
var numWins: Int
var currStreak: Int
var maxStreak: Int
var guessDist: [Int]
var winPercent: Int?
}
Since this is aggregate data I would want to store just one copy of this struct.
Does anyone have an example where this is being done? All the examples I've seen involve storing a collection of data.
Thanks