From 76c57af5486f63e776cd01631d18c4a74462cc80 Mon Sep 17 00:00:00 2001 From: Bryan Montz Date: Fri, 12 May 2023 07:18:12 -0500 Subject: [PATCH] add managed object class to match new Profile CoreData model --- damus.xcodeproj/project.pbxproj | 4 ++++ damus/Nostr/CoreData/PersistedProfile.swift | 24 +++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 damus/Nostr/CoreData/PersistedProfile.swift diff --git a/damus.xcodeproj/project.pbxproj b/damus.xcodeproj/project.pbxproj index f874ff59..581fd570 100644 --- a/damus.xcodeproj/project.pbxproj +++ b/damus.xcodeproj/project.pbxproj @@ -259,6 +259,7 @@ 50088DA129E8271A008A1FDF /* WebSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50088DA029E8271A008A1FDF /* WebSocket.swift */; }; 501F8C802A0220E1001AFC1D /* KeychainStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 501F8C7F2A0220E1001AFC1D /* KeychainStorage.swift */; }; 501F8C822A0224EB001AFC1D /* KeychainStorageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 501F8C812A0224EB001AFC1D /* KeychainStorageTests.swift */; }; + 501F8C5529FF5EF6001AFC1D /* PersistedProfile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 501F8C5429FF5EF6001AFC1D /* PersistedProfile.swift */; }; 501F8C5829FF5FC5001AFC1D /* Damus.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 501F8C5629FF5FC5001AFC1D /* Damus.xcdatamodeld */; }; 50A50A8D29A09E1C00C01BE7 /* RequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A50A8C29A09E1C00C01BE7 /* RequestTests.swift */; }; 50B5685329F97CB400A23243 /* CredentialHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50B5685229F97CB400A23243 /* CredentialHandler.swift */; }; @@ -683,6 +684,7 @@ 50088DA029E8271A008A1FDF /* WebSocket.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebSocket.swift; sourceTree = ""; }; 501F8C7F2A0220E1001AFC1D /* KeychainStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeychainStorage.swift; sourceTree = ""; }; 501F8C812A0224EB001AFC1D /* KeychainStorageTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeychainStorageTests.swift; sourceTree = ""; }; + 501F8C5429FF5EF6001AFC1D /* PersistedProfile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersistedProfile.swift; sourceTree = ""; }; 501F8C5729FF5FC5001AFC1D /* Damus.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Damus.xcdatamodel; sourceTree = ""; }; 50A50A8C29A09E1C00C01BE7 /* RequestTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RequestTests.swift; sourceTree = ""; }; 50B5685229F97CB400A23243 /* CredentialHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CredentialHandler.swift; sourceTree = ""; }; @@ -1364,6 +1366,7 @@ 501F8C5329FF5EE2001AFC1D /* CoreData */ = { isa = PBXGroup; children = ( + 501F8C5429FF5EF6001AFC1D /* PersistedProfile.swift */, 501F8C5629FF5FC5001AFC1D /* Damus.xcdatamodeld */, ); path = CoreData; @@ -1793,6 +1796,7 @@ F7908E92298B0F0700AB113A /* RelayDetailView.swift in Sources */, 4C3A1D332960DB0500558C0F /* Markdown.swift in Sources */, 4CE879552996BAB900F758CC /* RelayPaidDetail.swift in Sources */, + 501F8C5529FF5EF6001AFC1D /* PersistedProfile.swift in Sources */, 4CF0ABD42980996B00D66079 /* Report.swift in Sources */, 4C06670B28FDE64700038D2A /* damus.c in Sources */, 4C1A9A2529DDDF2600516EAC /* ZapSettingsView.swift in Sources */, diff --git a/damus/Nostr/CoreData/PersistedProfile.swift b/damus/Nostr/CoreData/PersistedProfile.swift new file mode 100644 index 00000000..a836d2f9 --- /dev/null +++ b/damus/Nostr/CoreData/PersistedProfile.swift @@ -0,0 +1,24 @@ +// +// PersistedProfile.swift +// damus +// +// Created by Bryan Montz on 4/30/23. +// + +import Foundation +import CoreData + +@objc(PersistedProfile) +final class PersistedProfile: NSManagedObject { + @NSManaged var id: String? + @NSManaged var name: String? + @NSManaged var display_name: String? + @NSManaged var about: String? + @NSManaged var picture: String? + @NSManaged var banner: String? + @NSManaged var website: String? + @NSManaged var lud06: String? + @NSManaged var lud16: String? + @NSManaged var nip05: String? + @NSManaged var last_update: Date? +}