Post

Replies

Boosts

Views

Activity

Reply to swift-frontend memory usage
I had the same issue and had to downgrade Xcode to 12.5.1 and the issue is gone. First I tried removing some code, including GeometryReader to avoid the problem, but it did not work. Tried other things such as restart Xcode, mac, launching other projects, cleaning derived data, cleaning up space for swap files etc. Nothing worked. With 12.5.1, there is not even one single process called swift-frontend, all views are rendered well in Canvas. I'd love to hear a possible solution as I would need to build for iOS15 eventually.
Oct ’21
Reply to iOS Simulator Cannot Read the Health Data I Saved
I have managed to save data that I can successfully read with the ReadData method (look at the original question). This is the new SaveData method : let now = Date() func SaveData() {         let configuration = HKWorkoutConfiguration()         configuration.activityType = .running         configuration.locationType = Int.random(in: 0..<2) == 0 ? .indoor : .outdoor         let builder = HKWorkoutBuilder(healthStore: healthStore, configuration: configuration, device: .local())         let sample = HKCumulativeQuantitySample(type: HKSampleType.quantityType(forIdentifier: HKQuantityTypeIdentifier.distanceWalkingRunning)!, quantity: HKQuantity.init(unit: HKUnit.meter(), doubleValue: 1230), start: now - 3600, end: now)         builder.add([sample]) { success, error in             guard success else {                 print("Error!")                 return             }             print("Added Sample")         }     }
Oct ’21
Reply to swift-frontend memory usage
I deep dived into my project and was able to avoid issue for one of my Views. By converting .padding(.leading, 20) to .padding(20) for a few Views (strangely it only occurs for horizontal paddings) resolved the issue. But it is not about paddings only, it is mixture of some cases which I could not figure out. Tried creating an empty view and added a few .padding(.leading, 20), problem wasn't there. My original View has pretty complex view structure, so it is almost impossible to create a workaround just by modifying my code. This is really terrible as I was learning SwiftUI and this would be my first SwiftUI project that I'd be uploading to AppStore. Now, I am about to start forgetting what I have learned. I can't imagine what kind of trouble I'd be in if this was a commercial project.
Nov ’21