Post

Replies

Boosts

Views

Activity

Error with Xcode 15 beta 5
I am getting the following error on this line of code @Query(sort: \.id, order: .reverse) private var artList: [ArtInventory] Cannot infer key path type from context; consider explicitly specifying a root type So, I select fix and then the line of code then look like this @Query(sort: \<#Root#>.id, order: .reverse) private var artList: [ArtInventory] with this error Invalid component of Swift key path Some seems to have changed with the @Query macro in beta 5, which now needs a root type, but not sure how to proceed. Any ideas how to fix?
1
1
1.6k
Jul ’23
SwiftChart with secondary Y Axis
I created a SwiftChart as below and I would like to have two YAxis, one for amount and the second for count. So, the amount YAxis is a different scale then the count YAxis. Does anybody have an example of this or shed some light on coding two different YAxis? Thanks ForEach(seriesArt) { series in ForEach(series.chartSeries.chartEntry) { BarMark( x: .value("Tier", $0.tier), y: .value("Price", $0.keyValue) ) } .foregroundStyle(by: .value("Count", series.chartCategory)) .position(by: .value("Price", series.chartCategory)) } } .frame(width: 400, height: 200) .chartXAxis { AxisMarks(position: .bottom, values: .automatic) { AxisValueLabel() .foregroundStyle(Color.white) } } .chartYAxis { AxisMarks(position: .leading, values: .automatic) { value in AxisGridLine(centered: true, stroke: StrokeStyle(lineWidth: 1)) AxisValueLabel() { if let intValue = value.as(Int.self) { Text("\(intValue)") .font(.system(size: 10)) .foregroundColor(.white) } } } .chartYAixs - for count sum by tier which needs to be a different scale from the amount YAxis } } }
1
0
1.1k
Apr ’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?
1
0
1.1k
Jun ’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
434
Aug ’24
How to Activate Printer Panel
How do you activate the Printer Panel using a toolbar printer Icon in a macOS app like you get when I select File -> Print (CMD-P)? This is in a tableView view based screen. I have connected the first responder to "print:" thinking this might work but the printer Icon in the toolbar remains grayed-out. Also, tried connecting it to a @IBAction func but it still is grayed out. I am using Xcode 13 and 14 beta
0
0
388
Jul ’22
How to create bar chart with two or more bars per time period
Environment: Xcode 14.1 beta 3 on macOS Ventura Beta 9. No longer need this, I found example of this. struct LocationsChart: View {     var body: some View {         Chart {             ForEach(seriesData, id: \.city) { series in                 ForEach(series.data, id: \.weekday) {                     BarMark(                         x: .value("Weekday", $0.weekday, unit: .day),                         y: .value("Sales", $0.sales)                     )                 }                 .foregroundStyle(by: .value("City", series.city))                 .position(by: .value("City", series.city))             }         }     }     let seriesData = [         (             city: "Cupertino", data: [                 (weekday: date(year: 2022, month: 5, day: 2), sales: 54),                 (weekday: date(year: 2022, month: 5, day: 3), sales: 42),                 (weekday: date(year: 2022, month: 5, day: 4), sales: 88),                 (weekday: date(year: 2022, month: 5, day: 5), sales: 49),                 (weekday: date(year: 2022, month: 5, day: 6), sales: 42),                 (weekday: date(year: 2022, month: 5, day: 7), sales: 125),                 (weekday: date(year: 2022, month: 5, day: 8), sales: 67)             ]         ),         (             city: "San Francisco", data: [                 (weekday: date(year: 2022, month: 5, day: 2), sales: 81),                 (weekday: date(year: 2022, month: 5, day: 3), sales: 90),                 (weekday: date(year: 2022, month: 5, day: 4), sales: 52),                 (weekday: date(year: 2022, month: 5, day: 5), sales: 72),                 (weekday: date(year: 2022, month: 5, day: 6), sales: 84),                 (weekday: date(year: 2022, month: 5, day: 7), sales: 84),                 (weekday: date(year: 2022, month: 5, day: 8), sales: 137)             ]         )     ] } func date(year: Int, month: Int, day: Int = 1) -> Date {     Calendar.current.date(from: DateComponents(year: year, month: month, day: day)) ?? Date() }
0
0
1.1k
Oct ’22
Is it possible to have secondary y axis with different scale?
Environment : macOS Ventura Xcode beta 14.1: I have the following chart I was using to learn about SwifUI Charts: I wanted to have different scales on the leading and trailing yaxis as well as have the first 3 bars to use leading scale and the last two bars use the trailing scale. Can this be done? If so, how? Thanks
Replies
1
Boosts
0
Views
1.2k
Activity
Oct ’22
Error with Xcode 15 beta 5
I am getting the following error on this line of code @Query(sort: \.id, order: .reverse) private var artList: [ArtInventory] Cannot infer key path type from context; consider explicitly specifying a root type So, I select fix and then the line of code then look like this @Query(sort: \<#Root#>.id, order: .reverse) private var artList: [ArtInventory] with this error Invalid component of Swift key path Some seems to have changed with the @Query macro in beta 5, which now needs a root type, but not sure how to proceed. Any ideas how to fix?
Replies
1
Boosts
1
Views
1.6k
Activity
Jul ’23
SwiftChart with secondary Y Axis
I created a SwiftChart as below and I would like to have two YAxis, one for amount and the second for count. So, the amount YAxis is a different scale then the count YAxis. Does anybody have an example of this or shed some light on coding two different YAxis? Thanks ForEach(seriesArt) { series in ForEach(series.chartSeries.chartEntry) { BarMark( x: .value("Tier", $0.tier), y: .value("Price", $0.keyValue) ) } .foregroundStyle(by: .value("Count", series.chartCategory)) .position(by: .value("Price", series.chartCategory)) } } .frame(width: 400, height: 200) .chartXAxis { AxisMarks(position: .bottom, values: .automatic) { AxisValueLabel() .foregroundStyle(Color.white) } } .chartYAxis { AxisMarks(position: .leading, values: .automatic) { value in AxisGridLine(centered: true, stroke: StrokeStyle(lineWidth: 1)) AxisValueLabel() { if let intValue = value.as(Int.self) { Text("\(intValue)") .font(.system(size: 10)) .foregroundColor(.white) } } } .chartYAixs - for count sum by tier which needs to be a different scale from the amount YAxis } } }
Replies
1
Boosts
0
Views
1.1k
Activity
Apr ’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
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
434
Activity
Aug ’24
How to Activate Printer Panel
How do you activate the Printer Panel using a toolbar printer Icon in a macOS app like you get when I select File -> Print (CMD-P)? This is in a tableView view based screen. I have connected the first responder to "print:" thinking this might work but the printer Icon in the toolbar remains grayed-out. Also, tried connecting it to a @IBAction func but it still is grayed out. I am using Xcode 13 and 14 beta
Replies
0
Boosts
0
Views
388
Activity
Jul ’22
Customize NSTableView alternate rows color
I would like customize the nstableview alternate row color as light blue instead og light gray. How is this done? thanks
Replies
0
Boosts
0
Views
610
Activity
Aug ’22
How to create bar chart with two or more bars per time period
Environment: Xcode 14.1 beta 3 on macOS Ventura Beta 9. No longer need this, I found example of this. struct LocationsChart: View {     var body: some View {         Chart {             ForEach(seriesData, id: \.city) { series in                 ForEach(series.data, id: \.weekday) {                     BarMark(                         x: .value("Weekday", $0.weekday, unit: .day),                         y: .value("Sales", $0.sales)                     )                 }                 .foregroundStyle(by: .value("City", series.city))                 .position(by: .value("City", series.city))             }         }     }     let seriesData = [         (             city: "Cupertino", data: [                 (weekday: date(year: 2022, month: 5, day: 2), sales: 54),                 (weekday: date(year: 2022, month: 5, day: 3), sales: 42),                 (weekday: date(year: 2022, month: 5, day: 4), sales: 88),                 (weekday: date(year: 2022, month: 5, day: 5), sales: 49),                 (weekday: date(year: 2022, month: 5, day: 6), sales: 42),                 (weekday: date(year: 2022, month: 5, day: 7), sales: 125),                 (weekday: date(year: 2022, month: 5, day: 8), sales: 67)             ]         ),         (             city: "San Francisco", data: [                 (weekday: date(year: 2022, month: 5, day: 2), sales: 81),                 (weekday: date(year: 2022, month: 5, day: 3), sales: 90),                 (weekday: date(year: 2022, month: 5, day: 4), sales: 52),                 (weekday: date(year: 2022, month: 5, day: 5), sales: 72),                 (weekday: date(year: 2022, month: 5, day: 6), sales: 84),                 (weekday: date(year: 2022, month: 5, day: 7), sales: 84),                 (weekday: date(year: 2022, month: 5, day: 8), sales: 137)             ]         )     ] } func date(year: Int, month: Int, day: Int = 1) -> Date {     Calendar.current.date(from: DateComponents(year: year, month: month, day: day)) ?? Date() }
Replies
0
Boosts
0
Views
1.1k
Activity
Oct ’22
Xcode 14.2 Find and Replace in Project not working
The find and replace in project is not working for me in Xcode 14.2 on Ventura 13.2. When I enter the find text as well as the replace text the "Replace" and "Replace All" buttons remained grayed out. Is this a bug with Xcode or am I missing something? Please advise.
Replies
0
Boosts
1
Views
638
Activity
Jan ’23