Post

Replies

Boosts

Views

Activity

Changing minimum deployment to iOS 17.0 Xcode compiler issues
I am developing an app that's near release. I changed the minimum deployment from iOS 16.X to 17.0 in order to be able to use the TipKit Framework. Making that change generated a ton of compiler warnings: .onChange(of:perform:)' was deprecated in iOS 17.0: Use onChange with a two or zero parameter action closure instead. After I fixed dozens of the warnings without issue, each subsequent attempt to fix a warning generated a compiler error: The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions. I decided to focus on just one file that had 13 different .onChange invocations. Nine were successfully converted to the new call, four were still deprecated. I tried to trace any possible source of type-check error for some of the simplest .onChange cases but nothing other than commenting out the .onChange in its entirety "fixed" the error. I tried commenting out one of the fixed/converted .onChange calls first and then fixing one of the problematic ones and that worked, no type-check error. The bottom line seems to be that I can only have nine of the new .onChange calls in that file, the other four have to be in the deprecated format or commented out. I tried upping the minimum deployment from 17.0 to 17.5 and that didn't work. I tried using a clean build folder and that also didn't work. Right now, I'm running Xcode 15.4 on Sonoma 14.7.2. I'm trying to avoid updating to the latest Xcode to avoid adding confounding variables and/or other possible issues. I am aware that for submission and release I will have to do so, I want to do it "on my terms" when everything is working properly. Any help would be appreciated.
Topic: UI Frameworks SubTopic: SwiftUI
3
0
145
3d
UIKit mapView color annotations
I have tried to make colored annotations in mapView (shown in the commented sections) but they always appear in black. Any help would be appreciated. func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? { let annotationView = MKAnnotationView(annotation: annotation, reuseIdentifier: "TempAnnotationView") annotationView.canShowCallout = true annotationView.rightCalloutAccessoryView = UIButton(type: .detailDisclosure) let configuration = UIImage.SymbolConfiguration(pointSize: 10, weight: .thin, scale: .default) if annotation.title == "Start" { // let config = UIImage.SymbolConfiguration.preferringMulticolor() // let image = UIImage(systemName: "flag.fill", withConfiguration: config) // // palette // let config2 = UIImage.SymbolConfiguration(paletteColors: [.systemRed, .systemGreen, .systemBlue]) // let image2 = UIImage(systemName: "person.3.sequence.fill", withConfiguration: config2) // // hierarchical symbols // let config3 = UIImage.SymbolConfiguration(hierarchicalColor: .systemIndigo) // let image3 = UIImage(systemName: "square.stack.3d.down.right.fill", withConfiguration: config3) // // color // let image4 = UIImage(systemName: "cone.fill")?.withTintColor(.systemRed, renderingMode: .alwaysTemplate) // annotationView.image = image4 annotationView.image = UIImage(systemName: "poweron", withConfiguration: configuration) } return annotationView }
1
0
635
Feb ’24
How can I access the HKMetadataKeySwimmingStrokeStyle enum?
I'm looking at a swimming workout sample and in the metadata I see: Optional(["HKIndoorWorkout": 0, "HKSwimmingLocationType": 2, "HKAverageMETs": 10.7366 kcal/hr·kg, "HKTimeZone": America/New_York]) There is no mention of the HKMetadataKeySwimmingStrokeStyle yet when I look at the workout in the Apple Fitness app, there is stroke style data. How can I access the stroke enum?
0
0
685
Feb ’24
Can HKWorkout be made Codable?
I'm thinking about developing a workout tracking app. To avoid the issue of having to repeatedly download workouts, I want to persist some app model data like Apple does with their Fitness App. At a minimum, the HKWorkout class. Has anyone seen this done before? I'd hate to have reinvent the wheel. HKWorkout: HKSample: HKObject: NSObject.
0
0
628
Jan ’24