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?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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)
}
Using Interface Builder with Xcode 11 I have created two windows, when I activate the second window it opens as a tab in the main window. How do I change this to start a second window instead of a tab?
Using a combo box after a selection I want to get control to take some actions based on the selection after press tab or return in the field. I have tried a few controls like the one below:
// textShouldEndEditing
func control(_ control: NSControl, textShouldEndEditing fieldEditor: NSText) - Bool {
print(#function,control.tag)
But the above control only gets control if the field is edited. I want control once tab, an item selected or return is pressed while on the filed. How is this done?
My environment is as follows:
Xcode 12, macOS BS developing a macOS app.
I have an IBOutlet from a IB window as
@IBOutlet weak var imageView: NSImageView!
So, I want to store imageView to a NSData object and then save the NSData object in my UserDefaults.
Once I saved the Image in my UserDefaults I need to be able to decode or retrieve the image for use in other parts of the app.
How is this done?
Also, I have seen some cautions about converting an Image to NSData object and retrieving. It seems the retrieved image may not be 100% as it was originally. Is this true and if so why?
Thanks
I have a macOS app which was built using Xcode 13 and storyboard. I want to add swiftCharts to the app. Can I add swiftCharts code to this app and not have to migrate the storyboard UI to swiftUI? How can this be done?
Thanks
I have the following code:
class ChartSeriesRow: ObservableObject {
var id = UUID()
var chartCategory: String
struct ChartSeriesData {
var chartEntry: [ChartData]
}
var chartSeries : ChartSeriesData
struct ChartData: Codable, Identifiable, Hashable {
var id = UUID()
let chartMonth: String
let chartSales: String
}
init() {
chartCategory = ""
chartSeries = ChartSeriesData(chartEntry: [ChartData(chartMonth: "01", chartSales: "10.0") ] )
}
}
How do I populate ChartSeriesData? I thought I could just add the following: However coding this way there is no append method.
extension ChartSeriesRow {
func addRow(chartRow: ChartSeriesData){
ChartSeriesRow.ChartSeriesData.chartEntry.append(contentsOf: chartRow)
}
}
Don't see a link to download the Xcode project, starter and complete?
How can I get it?
Thanks
Bob
How do you populate one column based on values of other column for a macOS app using Xcode 12 in a tableView?
The value of the first column comes from a comboBox which I get control by using the following code connected to the comboBox:
@IBAction func comboAction(_ sender: NSComboBox) {
print("Combo selected", sender.selectedTag(), sender.stringValue, sender.indexOfSelectedItem, sender.identifier as Any)
}
Then base on the value of the comboBox column within the comboAction function I want to populate column 2.
Can this be done? If so, how
From the class below how do I initialize chartEntry for the structure array? As it is below chartEntry is outside scope of init?
class ChartSeriesRow: ObservableObject {
var id = UUID()
var chartCategory: String
struct chartSeriesData{
var chartEntry: [ChartData]
}
struct ChartData: Codable, Identifiable, Hashable {
var id = UUID()
let chartMonth: String
let chartSales: String
}
init() {
chartCategory = ""
chartEntry = chartSeriesData: [ChartData.chartMonth: "01", ChartData.chartSales: "10.0"]
}
}
For a macOS app using Xcode 14.1. I have a bar chart with two bars for each interval. See screen chart below. I want to change the "Invoice" and Payments" text
I can't seem to find a modifier for the Legend text. How do you change the text color for SwiftUI Chart's legend text?
I have a test project with a bar progress indicator create on Ventura with Xcode 14.3.1., It does not show the any animation until the @IBAction function completes.
I want to show progress as it progresses not a just the end? Any ideas how to fix this?
Below is my test project code..
//
// ViewController.swift
// ProgressTest
//
// Created by Bob on 6/5/23.
//
import Cocoa
class ViewController: NSViewController {
@IBOutlet weak var progressIndicator: NSProgressIndicator!
// var progress: Double = 0.0
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override var representedObject: Any? {
didSet {
// Update the view, if already loaded.
}
}
@IBAction func progressStart(_ sender: Any) {
// Start the progress animation
progressIndicator.startAnimation(self)
// Do some work here...
// Do some work here...
var progress: Double = 0.0
for _ in 0..<100 {
// Update the progress value in a loop
progress += 1.0
progressIndicator.doubleValue = progress
// progress = Double(i)
// progressIndicator.increment(by: 10)
// progressIndicator.doubleValue = progress
// Do some work here...
}
// Stop the progress animation
progressIndicator.stopAnimation(self)
}
}
thanks
Bob
I understand by default SwiftData uses SQLite database but it can be configured to persist data in XML, binary and even in-memory databases. Does anybody know where SwiftData the SQLite database is located?
I have the following test code
import SwiftUI
struct ContentView: View {
@State private var field1 = ""
@State private var field2 = ""
@State private var field3 = ""
var body: some View {
VStack {
Form {
Section(header: Text("Input Fields")) {
TextField("Field 1", text: $field1)
TextField("Field 2", text: $field2)
TextField("Field 3", text: $field3)
}
}
List {
ForEach(1..<6) { index in
Text("Item \(index)")
}
}
.listStyle(InsetListStyle())
}
.navigationTitle("Form and List View")
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Button("Dismiss") {
// Handle dismiss action
}
.foregroundStyle(.red) //
}
ToolbarItem(placement: .primaryAction) {
Button("Done") {
// Handle done action
}
.foregroundStyle(.green) //
}
}
}
}
I can't customize the color of the Buttons. Besides .foreground modifier I have tried ..foregroundColor(.red) and .foregroundColor(.green) to no avail. How can I customize the buttons in the toolbar for both macOS and IOS
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"