Created
July 4, 2025 11:17
-
-
Save jacobsapps/e395a6c9ef49c53c6887d9eab058b3db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftData | |
| @Model | |
| final class CardEntity { | |
| @Attribute(.unique) var id: UUID | |
| var title: String | |
| var emoji: String | |
| var hexColor: String | |
| var rarity: String | |
| @Relationship(inverse: \StatEntity.card) var stats: [StatEntity] | |
| var imageData: Data | |
| var createdAt: Date | |
| } | |
| @Model | |
| final class StatEntity { | |
| var name: String | |
| var value: Double | |
| @Relationship var card: CardEntity? | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment