From 2bb47845a538b3ba2815be216876c43f6b5348aa Mon Sep 17 00:00:00 2001 From: Angelo Stavrow Date: Tue, 1 Sep 2020 16:11:51 -0400 Subject: [PATCH] Add WFACollection NSManagedObject class for local storage --- .../LocalStorageModel.xcdatamodel/contents | 14 ++++++++++- WFACollection+CoreDataClass.swift | 7 ++++++ WFACollection+CoreDataProperties.swift | 24 +++++++++++++++++++ .../project.pbxproj | 12 ++++++++++ 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 WFACollection+CoreDataClass.swift create mode 100644 WFACollection+CoreDataProperties.swift diff --git a/Shared/Models/LocalStorageModel.xcdatamodeld/LocalStorageModel.xcdatamodel/contents b/Shared/Models/LocalStorageModel.xcdatamodeld/LocalStorageModel.xcdatamodel/contents index af71c51..25e512d 100644 --- a/Shared/Models/LocalStorageModel.xcdatamodeld/LocalStorageModel.xcdatamodel/contents +++ b/Shared/Models/LocalStorageModel.xcdatamodeld/LocalStorageModel.xcdatamodel/contents @@ -1,4 +1,16 @@ - + + + + + + + + + + + + + \ No newline at end of file diff --git a/WFACollection+CoreDataClass.swift b/WFACollection+CoreDataClass.swift new file mode 100644 index 0000000..3f94575 --- /dev/null +++ b/WFACollection+CoreDataClass.swift @@ -0,0 +1,7 @@ +import Foundation +import CoreData + +@objc(WFACollection) +public class WFACollection: NSManagedObject { + +} diff --git a/WFACollection+CoreDataProperties.swift b/WFACollection+CoreDataProperties.swift new file mode 100644 index 0000000..dea6ea7 --- /dev/null +++ b/WFACollection+CoreDataProperties.swift @@ -0,0 +1,24 @@ +import Foundation +import CoreData + + +extension WFACollection { + + @nonobjc public class func fetchRequest() -> NSFetchRequest { + return NSFetchRequest(entityName: "WFACollection") + } + + @NSManaged public var alias: String? + @NSManaged public var title: String? + @NSManaged public var blogDescription: String? + @NSManaged public var styleSheet: String? + @NSManaged public var isPublic: Bool + @NSManaged public var views: Int16 + @NSManaged public var email: String? + @NSManaged public var url: String? + +} + +extension WFACollection : Identifiable { + +} diff --git a/WriteFreely-MultiPlatform.xcodeproj/project.pbxproj b/WriteFreely-MultiPlatform.xcodeproj/project.pbxproj index 6eb09b0..cb1063a 100644 --- a/WriteFreely-MultiPlatform.xcodeproj/project.pbxproj +++ b/WriteFreely-MultiPlatform.xcodeproj/project.pbxproj @@ -40,6 +40,10 @@ 1756DBB824FED3A400207AB8 /* LocalStorageModel.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 1756DBB524FED3A400207AB8 /* LocalStorageModel.xcdatamodeld */; }; 1756DBBA24FED45500207AB8 /* PersistenceManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1756DBB924FED45500207AB8 /* PersistenceManager.swift */; }; 1756DBBB24FED45500207AB8 /* PersistenceManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1756DBB924FED45500207AB8 /* PersistenceManager.swift */; }; + 1756DC0124FEE18400207AB8 /* WFACollection+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1756DBFF24FEE18400207AB8 /* WFACollection+CoreDataClass.swift */; }; + 1756DC0224FEE18400207AB8 /* WFACollection+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1756DBFF24FEE18400207AB8 /* WFACollection+CoreDataClass.swift */; }; + 1756DC0324FEE18400207AB8 /* WFACollection+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1756DC0024FEE18400207AB8 /* WFACollection+CoreDataProperties.swift */; }; + 1756DC0424FEE18400207AB8 /* WFACollection+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1756DC0024FEE18400207AB8 /* WFACollection+CoreDataProperties.swift */; }; 1762DCB324EB086C0019C4EB /* CollectionListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1762DCB224EB086C0019C4EB /* CollectionListModel.swift */; }; 1762DCB424EB086C0019C4EB /* CollectionListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1762DCB224EB086C0019C4EB /* CollectionListModel.swift */; }; 1765F62A24E18EA200C9EBF0 /* SidebarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1765F62924E18EA200C9EBF0 /* SidebarView.swift */; }; @@ -99,6 +103,8 @@ 1756DBB224FECDBB00207AB8 /* PostEditorStatusToolbarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostEditorStatusToolbarView.swift; sourceTree = ""; }; 1756DBB624FED3A400207AB8 /* LocalStorageModel.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = LocalStorageModel.xcdatamodel; sourceTree = ""; }; 1756DBB924FED45500207AB8 /* PersistenceManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersistenceManager.swift; sourceTree = ""; }; + 1756DBFF24FEE18400207AB8 /* WFACollection+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WFACollection+CoreDataClass.swift"; sourceTree = SOURCE_ROOT; }; + 1756DC0024FEE18400207AB8 /* WFACollection+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WFACollection+CoreDataProperties.swift"; sourceTree = SOURCE_ROOT; }; 1762DCB224EB086C0019C4EB /* CollectionListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectionListModel.swift; sourceTree = ""; }; 1765F62924E18EA200C9EBF0 /* SidebarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SidebarView.swift; sourceTree = ""; }; 17A5388724DDA31F00DEFF9A /* MacAccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MacAccountView.swift; sourceTree = ""; }; @@ -191,6 +197,8 @@ 1762DCB124EB07680019C4EB /* Models */ = { isa = PBXGroup; children = ( + 1756DBFF24FEE18400207AB8 /* WFACollection+CoreDataClass.swift */, + 1756DC0024FEE18400207AB8 /* WFACollection+CoreDataProperties.swift */, 1756AE6A24CB1E4B00FD7257 /* Post.swift */, 171BFDF624D49FD400888236 /* PostCollection.swift */, 1756AE6D24CB255B00FD7257 /* PostStore.swift */, @@ -569,8 +577,10 @@ 1762DCB324EB086C0019C4EB /* CollectionListModel.swift in Sources */, 1756AE7A24CB65DF00FD7257 /* PostListView.swift in Sources */, 171BFDF724D49FD400888236 /* PostCollection.swift in Sources */, + 1756DC0124FEE18400207AB8 /* WFACollection+CoreDataClass.swift in Sources */, 17DF32AA24C87D3500BCE2E3 /* WriteFreely_MultiPlatformApp.swift in Sources */, 17120DA724E19D11002B9F6C /* SettingsView.swift in Sources */, + 1756DC0324FEE18400207AB8 /* WFACollection+CoreDataProperties.swift in Sources */, 17120DA224E1985C002B9F6C /* AccountModel.swift in Sources */, 17120DA324E19A42002B9F6C /* PreferencesView.swift in Sources */, 1756AE6E24CB255B00FD7257 /* PostStore.swift in Sources */, @@ -597,6 +607,7 @@ 17120DAD24E1B99F002B9F6C /* AccountLoginView.swift in Sources */, 1756AE7B24CB65DF00FD7257 /* PostListView.swift in Sources */, 1753F6AC24E431CC00309365 /* MacPreferencesView.swift in Sources */, + 1756DC0424FEE18400207AB8 /* WFACollection+CoreDataProperties.swift in Sources */, 171BFDFB24D4AF8300888236 /* CollectionListView.swift in Sources */, 17DF32AB24C87D3500BCE2E3 /* WriteFreely_MultiPlatformApp.swift in Sources */, 17A5388C24DDC83F00DEFF9A /* AccountModel.swift in Sources */, @@ -604,6 +615,7 @@ 1756DBB824FED3A400207AB8 /* LocalStorageModel.xcdatamodeld in Sources */, 17A5389324DDED0000DEFF9A /* PreferencesView.swift in Sources */, 1756AE6F24CB255B00FD7257 /* PostStore.swift in Sources */, + 1756DC0224FEE18400207AB8 /* WFACollection+CoreDataClass.swift in Sources */, 1756DBB424FECDBB00207AB8 /* PostEditorStatusToolbarView.swift in Sources */, 1756AE6C24CB1E4B00FD7257 /* Post.swift in Sources */, 17A5388F24DDEC7400DEFF9A /* AccountView.swift in Sources */,