Add Data model for decks
This commit is contained in:
		| @@ -7,6 +7,8 @@ | |||||||
| 	objects = { | 	objects = { | ||||||
|  |  | ||||||
| /* Begin PBXBuildFile section */ | /* Begin PBXBuildFile section */ | ||||||
|  | 		6C4A87D22BE25D260074E0A9 /* Deck+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C4A87D02BE25D260074E0A9 /* Deck+CoreDataClass.swift */; }; | ||||||
|  | 		6C4A87D32BE25D260074E0A9 /* Deck+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C4A87D12BE25D260074E0A9 /* Deck+CoreDataProperties.swift */; }; | ||||||
| 		6C8184FE2B88C9580033CF46 /* WordAX.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C8184FD2B88C9580033CF46 /* WordAX.swift */; }; | 		6C8184FE2B88C9580033CF46 /* WordAX.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C8184FD2B88C9580033CF46 /* WordAX.swift */; }; | ||||||
| 		6C8185002B88C9660033CF46 /* WordAXModelView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C8184FF2B88C9660033CF46 /* WordAXModelView.swift */; }; | 		6C8185002B88C9660033CF46 /* WordAXModelView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C8184FF2B88C9660033CF46 /* WordAXModelView.swift */; }; | ||||||
| 		6C8185022B88C9FB0033CF46 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C8185012B88C9FB0033CF46 /* SettingsView.swift */; }; | 		6C8185022B88C9FB0033CF46 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C8185012B88C9FB0033CF46 /* SettingsView.swift */; }; | ||||||
| @@ -28,6 +30,8 @@ | |||||||
| /* End PBXBuildFile section */ | /* End PBXBuildFile section */ | ||||||
|  |  | ||||||
| /* Begin PBXFileReference section */ | /* Begin PBXFileReference section */ | ||||||
|  | 		6C4A87D02BE25D260074E0A9 /* Deck+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Deck+CoreDataClass.swift"; sourceTree = "<group>"; }; | ||||||
|  | 		6C4A87D12BE25D260074E0A9 /* Deck+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Deck+CoreDataProperties.swift"; sourceTree = "<group>"; }; | ||||||
| 		6C8184FD2B88C9580033CF46 /* WordAX.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WordAX.swift; sourceTree = "<group>"; }; | 		6C8184FD2B88C9580033CF46 /* WordAX.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WordAX.swift; sourceTree = "<group>"; }; | ||||||
| 		6C8184FF2B88C9660033CF46 /* WordAXModelView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WordAXModelView.swift; sourceTree = "<group>"; }; | 		6C8184FF2B88C9660033CF46 /* WordAXModelView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WordAXModelView.swift; sourceTree = "<group>"; }; | ||||||
| 		6C8185012B88C9FB0033CF46 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; }; | 		6C8185012B88C9FB0033CF46 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; }; | ||||||
| @@ -81,13 +85,31 @@ | |||||||
| 			path = Views; | 			path = Views; | ||||||
| 			sourceTree = "<group>"; | 			sourceTree = "<group>"; | ||||||
| 		}; | 		}; | ||||||
|  | 		6CD929862BE25B4600C2EB84 /* Deck */ = { | ||||||
|  | 			isa = PBXGroup; | ||||||
|  | 			children = ( | ||||||
|  | 				6C4A87D02BE25D260074E0A9 /* Deck+CoreDataClass.swift */, | ||||||
|  | 				6C4A87D12BE25D260074E0A9 /* Deck+CoreDataProperties.swift */, | ||||||
|  | 			); | ||||||
|  | 			path = Deck; | ||||||
|  | 			sourceTree = "<group>"; | ||||||
|  | 		}; | ||||||
|  | 		6CD929872BE25B5100C2EB84 /* Flashcard */ = { | ||||||
|  | 			isa = PBXGroup; | ||||||
|  | 			children = ( | ||||||
|  | 				6CEF7F822BC46B5900E205F6 /* Flashcard+CoreDataClass.swift */, | ||||||
|  | 				6CEF7FA12BC88F6000E205F6 /* Flashcard+CoreDataProperties.swift */, | ||||||
|  | 			); | ||||||
|  | 			path = Flashcard; | ||||||
|  | 			sourceTree = "<group>"; | ||||||
|  | 		}; | ||||||
| 		6CEF7F7B2BC456A100E205F6 /* Model */ = { | 		6CEF7F7B2BC456A100E205F6 /* Model */ = { | ||||||
| 			isa = PBXGroup; | 			isa = PBXGroup; | ||||||
| 			children = ( | 			children = ( | ||||||
|  | 				6CD929872BE25B5100C2EB84 /* Flashcard */, | ||||||
|  | 				6CD929862BE25B4600C2EB84 /* Deck */, | ||||||
| 				6CEF7F7C2BC457E600E205F6 /* DataController.swift */, | 				6CEF7F7C2BC457E600E205F6 /* DataController.swift */, | ||||||
| 				6CEF7F7F2BC4694900E205F6 /* WordAXCD.xcdatamodeld */, | 				6CEF7F7F2BC4694900E205F6 /* WordAXCD.xcdatamodeld */, | ||||||
| 				6CEF7F822BC46B5900E205F6 /* Flashcard+CoreDataClass.swift */, |  | ||||||
| 				6CEF7FA12BC88F6000E205F6 /* Flashcard+CoreDataProperties.swift */, |  | ||||||
| 			); | 			); | ||||||
| 			path = Model; | 			path = Model; | ||||||
| 			sourceTree = "<group>"; | 			sourceTree = "<group>"; | ||||||
| @@ -214,6 +236,8 @@ | |||||||
| 				6CF439522B83541D004C3543 /* WordAXApp.swift in Sources */, | 				6CF439522B83541D004C3543 /* WordAXApp.swift in Sources */, | ||||||
| 				6CEF7F522BC2DBF800E205F6 /* AddFlashCardView.swift in Sources */, | 				6CEF7F522BC2DBF800E205F6 /* AddFlashCardView.swift in Sources */, | ||||||
| 				6C8184FE2B88C9580033CF46 /* WordAX.swift in Sources */, | 				6C8184FE2B88C9580033CF46 /* WordAX.swift in Sources */, | ||||||
|  | 				6C4A87D22BE25D260074E0A9 /* Deck+CoreDataClass.swift in Sources */, | ||||||
|  | 				6C4A87D32BE25D260074E0A9 /* Deck+CoreDataProperties.swift in Sources */, | ||||||
| 				6CEF7F812BC4694900E205F6 /* WordAXCD.xcdatamodeld in Sources */, | 				6CEF7F812BC4694900E205F6 /* WordAXCD.xcdatamodeld in Sources */, | ||||||
| 				6C81850C2B8BA6BC0033CF46 /* FlashCardListRowView.swift in Sources */, | 				6C81850C2B8BA6BC0033CF46 /* FlashCardListRowView.swift in Sources */, | ||||||
| 				6CEF7F842BC46B5900E205F6 /* Flashcard+CoreDataClass.swift in Sources */, | 				6CEF7F842BC46B5900E205F6 /* Flashcard+CoreDataClass.swift in Sources */, | ||||||
|   | |||||||
							
								
								
									
										15
									
								
								WordAX/Model/Deck/Deck+CoreDataClass.swift
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								WordAX/Model/Deck/Deck+CoreDataClass.swift
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | |||||||
|  | // | ||||||
|  | //  Deck+CoreDataClass.swift | ||||||
|  | //  WordAX | ||||||
|  | // | ||||||
|  | //  Created by Oliver Hnát on 01.05.2024. | ||||||
|  | // | ||||||
|  | // | ||||||
|  |  | ||||||
|  | import Foundation | ||||||
|  | import CoreData | ||||||
|  |  | ||||||
|  | @objc(Deck) | ||||||
|  | public class Deck: NSManagedObject { | ||||||
|  |  | ||||||
|  | } | ||||||
							
								
								
									
										44
									
								
								WordAX/Model/Deck/Deck+CoreDataProperties.swift
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								WordAX/Model/Deck/Deck+CoreDataProperties.swift
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,44 @@ | |||||||
|  | // | ||||||
|  | //  Deck+CoreDataProperties.swift | ||||||
|  | //  WordAX | ||||||
|  | // | ||||||
|  | //  Created by Oliver Hnát on 01.05.2024. | ||||||
|  | // | ||||||
|  | // | ||||||
|  |  | ||||||
|  | import Foundation | ||||||
|  | import CoreData | ||||||
|  |  | ||||||
|  |  | ||||||
|  | extension Deck { | ||||||
|  |  | ||||||
|  |     @nonobjc public class func fetchRequest() -> NSFetchRequest<Deck> { | ||||||
|  |         return NSFetchRequest<Deck>(entityName: "Deck") | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     @NSManaged public var id: UUID? | ||||||
|  |     @NSManaged public var name: String? | ||||||
|  |     @NSManaged public var flashcards: NSSet? | ||||||
|  |  | ||||||
|  | } | ||||||
|  |  | ||||||
|  | // MARK: Generated accessors for flashcards | ||||||
|  | extension Deck { | ||||||
|  |  | ||||||
|  |     @objc(addFlashcardsObject:) | ||||||
|  |     @NSManaged public func addToFlashcards(_ value: Flashcard) | ||||||
|  |  | ||||||
|  |     @objc(removeFlashcardsObject:) | ||||||
|  |     @NSManaged public func removeFromFlashcards(_ value: Flashcard) | ||||||
|  |  | ||||||
|  |     @objc(addFlashcards:) | ||||||
|  |     @NSManaged public func addToFlashcards(_ values: NSSet) | ||||||
|  |  | ||||||
|  |     @objc(removeFlashcards:) | ||||||
|  |     @NSManaged public func removeFromFlashcards(_ values: NSSet) | ||||||
|  |  | ||||||
|  | } | ||||||
|  |  | ||||||
|  | extension Deck : Identifiable { | ||||||
|  |  | ||||||
|  | } | ||||||
| @@ -1,6 +1,11 @@ | |||||||
| <?xml version="1.0" encoding="UTF-8" standalone="yes"?> | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||||||
| <model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="22757" systemVersion="23D60" minimumToolsVersion="Automatic" sourceLanguage="Swift" usedWithSwiftData="YES" userDefinedModelVersionIdentifier=""> | <model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="22757" systemVersion="23D60" minimumToolsVersion="Automatic" sourceLanguage="Swift" usedWithSwiftData="YES" userDefinedModelVersionIdentifier=""> | ||||||
|     <entity name="Flashcard" representedClassName="Flashcard" syncable="YES"> |     <entity name="Deck" representedClassName="Deck" syncable="YES" coreSpotlightDisplayNameExpression="Deck"> | ||||||
|  |         <attribute name="id" attributeType="UUID" usesScalarValueType="NO"/> | ||||||
|  |         <attribute name="name" attributeType="String"/> | ||||||
|  |         <relationship name="flashcards" optional="YES" toMany="YES" deletionRule="Cascade" destinationEntity="Flashcard"/> | ||||||
|  |     </entity> | ||||||
|  |     <entity name="Flashcard" representedClassName="Flashcard" syncable="YES" coreSpotlightDisplayNameExpression="Card"> | ||||||
|         <attribute name="dateAdded" optional="YES" attributeType="Date" usesScalarValueType="NO"/> |         <attribute name="dateAdded" optional="YES" attributeType="Date" usesScalarValueType="NO"/> | ||||||
|         <attribute name="desc" optional="YES" attributeType="String"/> |         <attribute name="desc" optional="YES" attributeType="String"/> | ||||||
|         <attribute name="favorite" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/> |         <attribute name="favorite" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user