Post

Replies

Boosts

Views

Activity

Reply to SwiftChart with secondary Y Axis
You can do something like this: AxisMarks(position: .leading, values: Array(stride(from: yMin(), through: yMax(), by: 5))){ axis in AxisTick(stroke: .init(lineWidth: 2.5)).foregroundStyle(.pink) AxisGridLine() AxisValueLabel("\(Int((Double(axis.index)*5) + yMin()))", centered: false) } AxisMarks(position: .trailing, values: Array(stride(from: yMin(), through: yMin()+30, by: 5))){ axis in AxisTick(stroke: .init(lineWidth: 2.5)).foregroundStyle(.indigo) AxisGridLine() AxisValueLabel("\(Int(5*Double(axis.index))+10)", centered: false) } } But then you'll need to normalise the values for the second axis hence all the hack code in my AxisValueLabel content. I don't believe there's a more straight forward solution to your problem currently.
Apr ’24
Reply to Conditionally Migrate WatchOS 10 users ONLY to WidgetKit
@edford  Just an update to provide some new context with the recent WatchOS 10.3 release etc... I've done several updates to my app in the past few weeks and I still have issues from users running WatchOS 10.2/10.3 and WatchOS 9.6 For the WatchOS 9.6.3 users, I'm still seeing the exact same crashes as the one I submitted from September 23. For the WatchOS 10 users, I only see crash reports for users on 10.0, however I still get problems reported from users mostly around complications disappearing from their watch face. This is even from users running WatchOS 10.2, too early to say for 10.3 Should I reopen a bug report / feedback on this or is there something I'm still missing to avoid all this?
Jan ’24
Reply to Conditionally Migrate WatchOS 10 users ONLY to WidgetKit
And so many more from me: Translated Report (Full Report Below) Hardware Model: Watch6,18 Identifier: Sim.HeartRate.watchkitapp.WatchWidgetKitExtension AppVariant: 1:Watch6,18:9 Code Type: ARM64_32 (Native) Role: Unspecified Parent Process: launchd [1] Date/Time: 2023-09-24 20:11:54.9181 -0500 Launch Time: 2023-09-24 20:11:54.0000 -0500 OS Version: Watch OS 9.6.3 (20U502) Release Type: User Baseband Version: 5.04.01 Report Version: 104 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: DYLD 4 Symbol missing Symbol not found: _$s7SwiftUI17EnvironmentValuesV9WidgetKitE05ShowsE13BackgroundKeyVAA0cI0ADMc Referenced from: <7BA88B36-F66D-3527-9C49-CE859AB79FCB> /Volumes/VOLUME/*/<APP_NAME>.app/PlugIns/<APP_NAME> Watch WidgetKit Extension.appex/<APP_NAME> Watch WidgetKit Extension **(built for watchOS 10.0 which is newer than running OS)** Expected in: <15E32CD8-4D76-3F93-9881-7F8FDBB8A288> /System/Library/Frameworks/WidgetKit.framework/WidgetKit (terminated at launch; ignore backtrace) Triggered by Thread: 0 Thread 0 Crashed: 0 dyld 0x6dba6c5c 0x6db48000 + 388188 1 dyld 0x6dbb231c 0x6db48000 + 434972 2 dyld 0x6dbb234c 0x6db48000 + 435020 3 dyld 0x6db4c740 0x6db48000 + 18240 4 dyld 0x6db4abe0 0x6db48000 + 11232 5 dyld 0x6db4976c 0x6db48000 + 5996
Sep ’23
Reply to How can I get the highest sample rate historical heart rate data from health store?
Ok, lots to unpack here. These are my observations: Your query should return all available data within the time frame * You can manually view the actual data available in the Apple Health app under the Browse Tab -> Heart -> Heart Rate -> Show All Data (At the Bottom) I'm assuming that you're likely referring to Heart Rate data recorded by Apple Watch. In normal operating mode, Apple Watch will only generate a Heart Rate measurement every 4 - 5 minutes when the user is wearing their watch. If they start a workout, this increases to about 12 measurements per minute. This is where the HKQuantitySeriesSample comes in useful for efficiently querying this high intensity data This code would allow you to access the first HR value from the sample you have run if let result = results.first as? HKQuantitySample { print(result.quantity.doubleValue(for: HKUnit(from: "count/min"))) } To answer your last original question, you can't read Health data that is not there. For Heart Rate, I think from what you're saying, you either need to generate and save data to the Health Store, or wait for the user to record it (presumably via Apple Watch) before trying to read it *Right, going back to my original point and trying to answer your additional question. If you are querying the Health Store on iPhone, the Health Store data is only limited to what's actually saved in it, I'm not directly sure why you're only getting 10 days of data. That said, if its regular Heart Rate data the this is quite a big query, I'd recommend breaking it down into multiple queries and changing the predicate dates you have set. If you're querying on Apple Watch, you're only guaranteed to have access to the last 7 days of Health data.
Sep ’23