Post

Replies

Boosts

Views

Activity

Reply to Complications in WidgetKit - .accessoryCorner with curved text
Right, I've submitted 2 subtly different feedback for this. One for existing SDK and one for WatchOS 10. If this isn't resolved by WatchOS 10 I'm going to be in big trouble with my users because I need to implement WidgetKit to be in the Smart Stack. But If I implement it as is, I'll loose one of my most popular Complications which will really upset users. Stuck between a rock and a hard place.... plus I did confirm in a WWDC23 lab that WidgetKit implementation is all or nothing, you cannot run ClockKit & Widgetkit complications on the same Watch. Here are the feedbacks, FB12331689 & FB12331662 🙏 for a fix
Topic: App & System Services SubTopic: General Tags:
Jun ’23
Reply to Swift Charts Slow Navigation
Another +1 on this here. I'm trying to draw Charts with ~1,000 point marks and scroll through them in a page style tab view. Even on the latest devices there's noticeable lag. Was wondering if there's anything that can be done to pre-draw them, optimise the data set or something. Currently I just use: In the View initialiser: let data:[(Date,Double)] And in the view body: ForEach(0..<data.count, id: \.self) { index in PointMark( x: .value("Time", data[index].0), y: .value("Data", data[index].1) ) } Many thanks for any suggestions
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’23
Reply to Migrating ClockKit complications to WidgetKit not working
I've found the Apple Watch Face Editor on iPhone is still not reliable when doing the WIdgetKit migration. See separate post here for details on that, any ideas welcome. As for the migration, I'm having success with the getWidgetConfiguration in my ComplicationController which conforms to the CLKComplicationWidgetMigrator I provide it the identifier for the widget configuration and I provide the Widget bundle extension identifier. Although I have widgets on iPhone and Apple Watch, I provide separate Extension targets and identifiers as I was struggling to get the right entitlements with a combined one. If there are any other details I can provide to help please let me know!
Topic: App & System Services SubTopic: General Tags:
Jul ’23
Reply to App group shared user defaults
What about if I want to share a preference between a Watch App WidgetKit Extension (for Watch Face complications) and a Watch app? I don't see how any of the suggested methods would apply to a WidgetKit extension.... This has worked for me previously when sharing between iPhone App and iPhone Widget Extension.
Topic: App & System Services SubTopic: General Tags:
Aug ’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.
Topic: App & System Services SubTopic: Core OS Tags:
Sep ’23