Post

Replies

Boosts

Views

Activity

Deleting CloudKit data
I have been testing an app which uses cloudKit with SWIFTDATA and after testing for several months my 200GB iCloud store is showing 168GB for iCloud Drive. Now my iCloud drive is only 22.6GB so the rest of the 168GB must be data from my app. Also, I have function in my app to delete all iCloud Data which I thought that should clean up iCloud storage but it does not. I tried resetting the Develop Environment but no change to iCloud data. Also I have several other containers in iCloud created while getting iCloud working which I would like to delete but I understand you can’t. https://forums.developer.apple.com/forums/thread/45251?answerId=788694022#788694022 Bottom line cloudkit console has been pretty much useless for me and I need a way to manage (delete containers and data). Am I missing something?
1
0
1.1k
Jun ’24
SwiftData Tables disappearing while test my app!
I begin testing my IOS swiftdats Xcode 15 swift 5 on Sonoma and I am able to create my siwftdata tables as well as add records to several of the tables, Then as I proceeded with my te tables disappear and I get this error in the Xcode debug console: error: Error: Persistent History (6) has to be truncated due to the following entities being removed: ( AppSettings, Invoice, Clientele, Pay, InvoiceItem, TrackingArt ) This app used to work fine and as I was making changes it started behaving in this manner. Beside the code I will supply the entire debug console with the attached file debugConsole.txt Here is how I have the swift data containers setup. import SwiftData import TipKit import CloudKit @main struct ArtManagerApp: App { @StateObject private var copyInvoiceDetails = CopyInvoiceDetails() @StateObject private var copyPaymentDetails = CopyPaymentDetails() @StateObject private var artTypeSettings = ArtTypeSettings() @StateObject private var tipManager = TipManager() // @Query(sort: \ArtPiece.artPieceID, order: .forward) private var artPieces: [ArtPiece] // @Query(sort: \AppSettings.setID, order: .reverse) private var settingsList: [AppSettings] var sharedModelContainer: ModelContainer = { let schema = Schema([ ArtPiece.self, Clientele.self, TrackingArt.self, Invoice.self, InvoiceItem.self, AppSettings.self, Pay.self ]) let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false) do { return try ModelContainer(for: schema, configurations: [modelConfiguration]) } catch { fatalError("Could not create ModelContainer: \(error)") } }() var body: some Scene { WindowGroup { ContentView() .navigationTitle("🎨 Art Manager") .environmentObject(artTypeSettings) .environmentObject(copyInvoiceDetails) .environmentObject(copyPaymentDetails) .environmentObject(tipManager) // Pass it to the ContentView .modelContainer(sharedModelContainer) } } } class TipManager: ObservableObject { @Published var tips: [ArtManagerTip] = [] init() { loadTips() } func loadTips() { tips = [ArtManagerTips.search_tip, ArtManagerTips.delete_tip, ArtManagerTips.extendedSearch_tip, ArtManagerTips.searchPayments_tip, ArtManagerTips.searchArt_tip, ArtManagerTips.librarySearch_tip, ArtManagerTips.artMaintenanceSearch_tip] } } class CopyPaymentDetails: ObservableObject { @Published var payNumber: Int32 = 0 @Published var payType: String = "" @Published var payPatronID: Int32 = 0 @Published var payPatronName: String = "" @Published var payPatronAddress: String = "" @Published var payPaymentAmount: Double = 0.0 @Published var payDatePayed: Date = Date() } class CopyInvoiceDetails: ObservableObject { @Published var invoiceNumber: Int32 = 0 @Published var invoicePatronName: String = "" @Published var invoicePatronPO: String = "" @Published var invoiceDateCreated: Date = Date() @Published var artPieceIDSaved: [Int32] = [] }
7
0
1.4k
Aug ’24
NavlgationLink Code not working on macOS Sequoia
This code which works fine on macOS Sonoma but on Sequoia the navigationLinks do not work? VStack { Text("Application Global Values") .font(.largeTitle) .fontWeight(.bold) .padding(.bottom, 10) Text("Select each of the Descriptors, enter the values and when done then Tap on (Add/Save)") .font(.title3) .foregroundColor(.secondary) List { NavigationLink("Enter Core Descriptors", destination: CoreView(systemSettings: $systemSettings)) .padding() // Add padding to create some space inside the border // .background(Color.white) // Optional: Add a background color if needed // .border(Color.red, width: 2) // Add a red border with a specified thickness .overlay( RoundedRectangle(cornerRadius: 10) // Specify the corner radius for rounded corners .stroke(Color.red, lineWidth: 2) // Define the color and thickness of the border ) SetupDivider(thickness: 3) NavigationLink("Enter Counters Descriptors", destination: CountersView(systemSettings: $systemSettings)) .padding() // .background(Color.white) .overlay( RoundedRectangle(cornerRadius: 10) // Specify the corner radius for rounded corners .stroke(Color.red, lineWidth: 2) // Define the color and thickness of the border ) SetupDivider(thickness: 3) NavigationLink("Create Custom Descriptors", destination: UserFieldsView(userFields: $userFields)) .padding() // .background(Color.white) .overlay( RoundedRectangle(cornerRadius: 10) // Specify the corner radius for rounded corners .stroke(Color.red, lineWidth: 2) // Define the color and thickness of the border ) SetupDivider(thickness: 3) NavigationLink("View All Descriptors", destination: DefaultDetailView(userFields: $userFields, systemSettings: $systemSettings)) .padding() // .background(Color.white) .overlay( RoundedRectangle(cornerRadius: 10) // Specify the corner radius for rounded corners .stroke(Color.red, lineWidth: 2) // Define the color and thickness of the border ) SetupDivider(thickness: 3) }
1
0
446
Aug ’24
Swiftui Table statement conditional table columns
Is it possible to have conditional table columns for a swifui Table statement? Like for this code TableColumn("Image") { artPiece in if let imageData = artPiece.artImage.first, let image = UIImage(data: imageData!) { Image(uiImage: image) .resizable() .frame(width: 50, height: 50) } else { Image(systemName: "photo") .resizable() .frame(width: 50, height: 50) } } .customizationID("Image") TableColumn("Name", value: \.artName) .customizationID("Name") TableColumn ("Art ID", value: \.artPieceID) { artPiece in Text(String(artPiece.artPieceID)) } .customizationID("Art ID") have a conditional TableColumn for this part of my SWIFTDATA model var artDefinedFields: [ArtDefinedFields] = [] or if I change the variable string array to this var artDefinedFields: [ArtDefinedFields] = Array(repeating: ArtDefinedFields(), count: 10), initialize the array with "None" and only create a TableColumn when there is aArtDeginedFields value other than "None"
3
0
678
Aug ’24
Deleting CloudKit data
I have been testing an app which uses cloudKit with SWIFTDATA and after testing for several months my 200GB iCloud store is showing 168GB for iCloud Drive. Now my iCloud drive is only 22.6GB so the rest of the 168GB must be data from my app. Also, I have function in my app to delete all iCloud Data which I thought that should clean up iCloud storage but it does not. I tried resetting the Develop Environment but no change to iCloud data. Also I have several other containers in iCloud created while getting iCloud working which I would like to delete but I understand you can’t. https://forums.developer.apple.com/forums/thread/45251?answerId=788694022#788694022 Bottom line cloudkit console has been pretty much useless for me and I need a way to manage (delete containers and data). Am I missing something?
Replies
1
Boosts
0
Views
1.1k
Activity
Jun ’24
SwiftData Tables disappearing while test my app!
I begin testing my IOS swiftdats Xcode 15 swift 5 on Sonoma and I am able to create my siwftdata tables as well as add records to several of the tables, Then as I proceeded with my te tables disappear and I get this error in the Xcode debug console: error: Error: Persistent History (6) has to be truncated due to the following entities being removed: ( AppSettings, Invoice, Clientele, Pay, InvoiceItem, TrackingArt ) This app used to work fine and as I was making changes it started behaving in this manner. Beside the code I will supply the entire debug console with the attached file debugConsole.txt Here is how I have the swift data containers setup. import SwiftData import TipKit import CloudKit @main struct ArtManagerApp: App { @StateObject private var copyInvoiceDetails = CopyInvoiceDetails() @StateObject private var copyPaymentDetails = CopyPaymentDetails() @StateObject private var artTypeSettings = ArtTypeSettings() @StateObject private var tipManager = TipManager() // @Query(sort: \ArtPiece.artPieceID, order: .forward) private var artPieces: [ArtPiece] // @Query(sort: \AppSettings.setID, order: .reverse) private var settingsList: [AppSettings] var sharedModelContainer: ModelContainer = { let schema = Schema([ ArtPiece.self, Clientele.self, TrackingArt.self, Invoice.self, InvoiceItem.self, AppSettings.self, Pay.self ]) let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false) do { return try ModelContainer(for: schema, configurations: [modelConfiguration]) } catch { fatalError("Could not create ModelContainer: \(error)") } }() var body: some Scene { WindowGroup { ContentView() .navigationTitle("🎨 Art Manager") .environmentObject(artTypeSettings) .environmentObject(copyInvoiceDetails) .environmentObject(copyPaymentDetails) .environmentObject(tipManager) // Pass it to the ContentView .modelContainer(sharedModelContainer) } } } class TipManager: ObservableObject { @Published var tips: [ArtManagerTip] = [] init() { loadTips() } func loadTips() { tips = [ArtManagerTips.search_tip, ArtManagerTips.delete_tip, ArtManagerTips.extendedSearch_tip, ArtManagerTips.searchPayments_tip, ArtManagerTips.searchArt_tip, ArtManagerTips.librarySearch_tip, ArtManagerTips.artMaintenanceSearch_tip] } } class CopyPaymentDetails: ObservableObject { @Published var payNumber: Int32 = 0 @Published var payType: String = "" @Published var payPatronID: Int32 = 0 @Published var payPatronName: String = "" @Published var payPatronAddress: String = "" @Published var payPaymentAmount: Double = 0.0 @Published var payDatePayed: Date = Date() } class CopyInvoiceDetails: ObservableObject { @Published var invoiceNumber: Int32 = 0 @Published var invoicePatronName: String = "" @Published var invoicePatronPO: String = "" @Published var invoiceDateCreated: Date = Date() @Published var artPieceIDSaved: [Int32] = [] }
Replies
7
Boosts
0
Views
1.4k
Activity
Aug ’24
NavlgationLink Code not working on macOS Sequoia
This code which works fine on macOS Sonoma but on Sequoia the navigationLinks do not work? VStack { Text("Application Global Values") .font(.largeTitle) .fontWeight(.bold) .padding(.bottom, 10) Text("Select each of the Descriptors, enter the values and when done then Tap on (Add/Save)") .font(.title3) .foregroundColor(.secondary) List { NavigationLink("Enter Core Descriptors", destination: CoreView(systemSettings: $systemSettings)) .padding() // Add padding to create some space inside the border // .background(Color.white) // Optional: Add a background color if needed // .border(Color.red, width: 2) // Add a red border with a specified thickness .overlay( RoundedRectangle(cornerRadius: 10) // Specify the corner radius for rounded corners .stroke(Color.red, lineWidth: 2) // Define the color and thickness of the border ) SetupDivider(thickness: 3) NavigationLink("Enter Counters Descriptors", destination: CountersView(systemSettings: $systemSettings)) .padding() // .background(Color.white) .overlay( RoundedRectangle(cornerRadius: 10) // Specify the corner radius for rounded corners .stroke(Color.red, lineWidth: 2) // Define the color and thickness of the border ) SetupDivider(thickness: 3) NavigationLink("Create Custom Descriptors", destination: UserFieldsView(userFields: $userFields)) .padding() // .background(Color.white) .overlay( RoundedRectangle(cornerRadius: 10) // Specify the corner radius for rounded corners .stroke(Color.red, lineWidth: 2) // Define the color and thickness of the border ) SetupDivider(thickness: 3) NavigationLink("View All Descriptors", destination: DefaultDetailView(userFields: $userFields, systemSettings: $systemSettings)) .padding() // .background(Color.white) .overlay( RoundedRectangle(cornerRadius: 10) // Specify the corner radius for rounded corners .stroke(Color.red, lineWidth: 2) // Define the color and thickness of the border ) SetupDivider(thickness: 3) }
Replies
1
Boosts
0
Views
446
Activity
Aug ’24
Swiftui Table statement conditional table columns
Is it possible to have conditional table columns for a swifui Table statement? Like for this code TableColumn("Image") { artPiece in if let imageData = artPiece.artImage.first, let image = UIImage(data: imageData!) { Image(uiImage: image) .resizable() .frame(width: 50, height: 50) } else { Image(systemName: "photo") .resizable() .frame(width: 50, height: 50) } } .customizationID("Image") TableColumn("Name", value: \.artName) .customizationID("Name") TableColumn ("Art ID", value: \.artPieceID) { artPiece in Text(String(artPiece.artPieceID)) } .customizationID("Art ID") have a conditional TableColumn for this part of my SWIFTDATA model var artDefinedFields: [ArtDefinedFields] = [] or if I change the variable string array to this var artDefinedFields: [ArtDefinedFields] = Array(repeating: ArtDefinedFields(), count: 10), initialize the array with "None" and only create a TableColumn when there is aArtDeginedFields value other than "None"
Replies
3
Boosts
0
Views
678
Activity
Aug ’24