I literally have just started the Core Data lesson, but I am very excited to learn about using it. My theoretical question is that prior to this lesson Paul has emphasized the use of structs to store data, and having a single class to hold a reference to groups of structs that can be used across all Swift UI views, which I think I understand.
The problem I am thinking about is the following:
Lets say you have a sports app with the following data model. There is a single instance of class League which is shared across all views. The league has an array of [Team] where each Team is a struct. Each Team has two arrays, one of [Coach] where each Coach is a struct with name, id, number, etc, all basic property types, and [Player] where each Player is a struct with properties of name, id, number, and various stats. etc.
Each view accesses the various properties to display what is wanted, etc.
Now, Core Data uses classes for each entity, and not structs and as far as I can figure out, cannot store structs directly due to limited types.
How do you make the data model for the sports app work with Core Data and maintain the use of the structs as recommended in Swift?
I searched forum and google and could not clearly find an explanation that explains the theory without going into a lot of specific code.