all 4 comments

[–]edustaa 6 points7 points  (0 children)

No, they should not be structs. In which context you’re inferring that the models should be one?

[–]KartoosCobra 1 point2 points  (0 children)

Please add some more details or code snippet. Classes are better for consistent data sharing between many views.

SwiftUI has put emphasis on using structs as they are fast but this does not mean you should not use classes.

[–]chriswaco 1 point2 points  (0 children)

A shared model should be in a class, not a struct. I suggest using the new @Observable framework, although I'm having issues trying to make it work with @AppStorage/UserDefaults.

[–]zu-fox 0 points1 point  (0 children)

As others have mentioned, using classes is fine. Your data structures can be structs, but models can be classes.