Post

Replies

Boosts

Views

Activity

Reply to Maximise background update on WatchOS
Hi Ziqiao, Thank you very much for the reply and details on this issue. This information is helpful. If I could just specifically clarify a couple of points just so it's really clear. When the background HealthKit observer query does wake my Watch app in the background and I call WidgetCenter.shared.reloadAllTimelines() before the completion handler, does this remove one of my separate widget extension budget's 4 hourly reloads? With regards to BGAppRefreshTaskRequest, I am confused here. Xcode does offer some supported modes to use this with Watch apps and the link you provided does show availability from WatchOS 6.0+.... Sorry I'm probably missing something here! Many thanks
Jun ’25
Reply to WidgetKit WidgetConfigurationIntent Parameter Icons
I have solved this problem. The answer was in the WWDC25 video Get to know App Intends. Here's an example of an WidgetConfigurationIntent to toggle a chart showing data points on or off including icons for the two data point display options. struct WatchDataPointsWidgetIntent: AppIntent, WidgetConfigurationIntent { static var title: LocalizedStringResource = "Data Points Widget Configuration" static var description = IntentDescription("Configure individual data point display for Watch Widgets.") static var isDiscoverable: Bool { return false} init() {} func perform() async throws -> some IntentResult { print("WatchDataPointsWidgetIntent perform") return .result() } @Parameter(title: "Chart Display Options", default: ChartDataPointsOption.showDataPoints) var showDataPoints: ChartDataPointsOption? static var parameterSummary: some ParameterSummary { Summary("Chart Options: \(\.$showDataPoints)") } } enum ChartDataPointsOption: String, AppEnum { case showDataPoints case hideDataPoints static let typeDisplayRepresentation = TypeDisplayRepresentation(name: "Chart Display Data Points") static let caseDisplayRepresentations: [Self: DisplayRepresentation] = [ ChartDataPointsOption.showDataPoints: DisplayRepresentation(title: "Individual Data Points", image: .init(systemName: "chart.dots.scatter")), ChartDataPointsOption.hideDataPoints: DisplayRepresentation(title: "Percentiles Only", image: .init(systemName: "chart.line.uptrend.xyaxis")) ] }
Jun ’25
Reply to widget can access HealthKit data?
Just want to expand a bit on the answer here. Yes Widgets can access the Health store. However, you need other remember that the Health store is only available when the device is unlocked. I will list a few limitations that come to mind from this. There's currently no way to request widget timeline updates only when the device is unlocked. There's currently no way to get reliable updates for iPhone widgets mirrored on Mac that include Health data, these will only update when the user unlocks their iPhone. Widgets on the iPhone Lock Screen can only update their Health data when the device is unlocked, this means if you're displaying a step count for example, it won't update throughout the day automatically. The same also applies to widgets in the Standby mode on iPhone. I've previously posted multiple feedback regarding this. The latest one is FB13879739 although it was closed... maybe we'll see some improvements here one day.
Apr ’25
Reply to What's the correct way to check for unavailable API?
I think I originally didn't file the feedback as I assumed there would be a way to do the availability check and didn't see it as a "bug". There's also the slight problem not not getting responses to feedback 😕 In any case, It is now resolved in the latest iOS 18.1 beta 4 seed (although I'll have to wait a little for testers to update to is before changing my app code to support the API in iOS 18.1 - the crashes will still be my fault!) I have now also filed feedback FB15252677 😊
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’24
Reply to What's the correct way to check for unavailable API?
Thank you for the further information. It's good to know there's no specific availability clause I could have otherwise added. Regarding your comment: "Situations like this are exceedingly rare".... Apple increasingly likes withholding a few features from the annual iOS X.0 betas over the summer and then adding them in for RC candidates. (Who doesn't love a surprise!) This can also happen for iOS X.X releases if It coincides with a new feature from a product launch. Over the years with the existence of public betas there is greater percentage of users running beta OS versions. At the same time most major OS updates in beta through the summer have added additional beta branches (iOS 16, 17 & 18 have all added X.1 betas before X.0 was released). Beta users will blame third party apps for crashes that occur even in the post example where it's really to do with their OS "branch" for lack of a better term. Going forward it seems we do need a better way to check this availability in Swift or Apple needs to work to align beta updates of OS X.X to OS X.X+1 if that makes sense.... Otherwise this problem will reoccur with seemingly no way to avoid it. On this specific example, it's not fixed in iOS 18.1 Beta 4 or Xcode 16.1 Beta 2, but I haven't filed a feedback as it's almost impossible for it not to be fixed pre-release, many apps including the Health app would break if it wasn't.
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’24
Reply to Swift Charts 'Pink' chart drawing issue?
Apologies, this isn't really that helpful but I've never seen this issue and I do a lot of developing with Swift Chart on WatchOS 9, 10 and 11. The only vaguely similar thing I've seen before was an issue when trying to render a SwiftUI chart as an image when it had the .chartXSelection API set for interaction. Otherwise, I'd just have a look if there's anything else fairly unique you're doing with the chart. Maybe posting some of it's code could help.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’24
Reply to App not compatible with iPad model, but it is?
I've confirmed with an Apple DTS Engineer this is likely a bug. The workaround is to remove the healthkit value set for UIRequiredDeviceCapabililties in my Info.plist, hopefully this helps someone! I've since been able to update my app. Many thanks to @edford for helping here I've filed feedback FB14780645 to try and get this fixed for other users one day!
Aug ’24
Reply to SwiftCharts Not Showing Accurate Data Until Tap Gesture on Chart
One thought comes to mind which I've seen a similar issue on when using Swift Charts in a TabView. You could try setting the .id() modifier on the chart maybe with the date of the day the chart is displaying. For myself this resolved an issue where I has a Swift Chart (actually showing Health data) for each day and the wrong days were displayed sometimes when scrolling through the TabView. Hope this helps, apologies if it doesn't!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’24
Reply to Resting Heart Rate - Individual readings?
Are you referring to data measured by Apple Watch? If so then my understanding (as of iOS 17 & WatchOS 10) is: Apple Watch records the users Heart Rate roughly every 4-6 minutes throughout the day when on the users wrist and not in low power mode These Heart Rate readings go to 10’s per minute during a Workout Apple Watch only generates one Resting Heart Rate value per day This single Resting value is updated during the day if needed rather than additional values being saved to Apple Health To answer your question on querying the data that makes up a Resting Heart Rate value, I don’t think this is specifically possible. Essentially Apple have created an algorithm which uses the raw Heart Rate data to generate the Resting Heart Rate value, this algorithm is not public to my knowledge, and it has also changed over the years (for example, it used to incorporate all HR data throughout the day, now it ignores HR measured during Sleep). You will need to query those individual readings as you are doing with a HKHeartbeatSeriesQuery. Hope this helps!
Jul ’24
Reply to Maximise background update on WatchOS
Hi Ziqiao, Thank you very much for the reply and details on this issue. This information is helpful. If I could just specifically clarify a couple of points just so it's really clear. When the background HealthKit observer query does wake my Watch app in the background and I call WidgetCenter.shared.reloadAllTimelines() before the completion handler, does this remove one of my separate widget extension budget's 4 hourly reloads? With regards to BGAppRefreshTaskRequest, I am confused here. Xcode does offer some supported modes to use this with Watch apps and the link you provided does show availability from WatchOS 6.0+.... Sorry I'm probably missing something here! Many thanks
Replies
Boosts
Views
Activity
Jun ’25
Reply to WidgetKit WidgetConfigurationIntent Parameter Icons
I have solved this problem. The answer was in the WWDC25 video Get to know App Intends. Here's an example of an WidgetConfigurationIntent to toggle a chart showing data points on or off including icons for the two data point display options. struct WatchDataPointsWidgetIntent: AppIntent, WidgetConfigurationIntent { static var title: LocalizedStringResource = "Data Points Widget Configuration" static var description = IntentDescription("Configure individual data point display for Watch Widgets.") static var isDiscoverable: Bool { return false} init() {} func perform() async throws -> some IntentResult { print("WatchDataPointsWidgetIntent perform") return .result() } @Parameter(title: "Chart Display Options", default: ChartDataPointsOption.showDataPoints) var showDataPoints: ChartDataPointsOption? static var parameterSummary: some ParameterSummary { Summary("Chart Options: \(\.$showDataPoints)") } } enum ChartDataPointsOption: String, AppEnum { case showDataPoints case hideDataPoints static let typeDisplayRepresentation = TypeDisplayRepresentation(name: "Chart Display Data Points") static let caseDisplayRepresentations: [Self: DisplayRepresentation] = [ ChartDataPointsOption.showDataPoints: DisplayRepresentation(title: "Individual Data Points", image: .init(systemName: "chart.dots.scatter")), ChartDataPointsOption.hideDataPoints: DisplayRepresentation(title: "Percentiles Only", image: .init(systemName: "chart.line.uptrend.xyaxis")) ] }
Replies
Boosts
Views
Activity
Jun ’25
Reply to iOS 26: How to achieve TabView effect like in the Find My app.
Is it possible that this isn't actually a TabView but instead a custom sheet that has the interactiveDismissDisabled(_:) and .presentationDetents() maybe? Just a thought anyway as the map behind is unchanged by selections on the bottom buttons.
Topic: UI Frameworks SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’25
Reply to HealthKit heart rate zones
I've filled a feedback for this after WWDC 23 and 24. Here's the latest one FB13879424 This is really important. Let's 🙏 for WWDC25
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’25
Reply to widget can access HealthKit data?
Just want to expand a bit on the answer here. Yes Widgets can access the Health store. However, you need other remember that the Health store is only available when the device is unlocked. I will list a few limitations that come to mind from this. There's currently no way to request widget timeline updates only when the device is unlocked. There's currently no way to get reliable updates for iPhone widgets mirrored on Mac that include Health data, these will only update when the user unlocks their iPhone. Widgets on the iPhone Lock Screen can only update their Health data when the device is unlocked, this means if you're displaying a step count for example, it won't update throughout the day automatically. The same also applies to widgets in the Standby mode on iPhone. I've previously posted multiple feedback regarding this. The latest one is FB13879739 although it was closed... maybe we'll see some improvements here one day.
Replies
Boosts
Views
Activity
Apr ’25
Reply to Question about transparent widget background
I would say post some screenshot examples of this. I'm fairly sure it's not possible with the existing APIs and they get around it by having the same background photo that you use for your home screen.
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Apr ’25
Reply to Migrating to WidgetKit, issues with editing Watch Faces on iPhone
Similar thread now started here: https://developer.apple.com/forums/thread/763164
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to ClockKit to WidgetKit migration bug
Pretty sure this is the same thing I first mentioned here 15 months ago 😕 https://developer.apple.com/forums/thread/732751
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to What's the correct way to check for unavailable API?
I think I originally didn't file the feedback as I assumed there would be a way to do the availability check and didn't see it as a "bug". There's also the slight problem not not getting responses to feedback 😕 In any case, It is now resolved in the latest iOS 18.1 beta 4 seed (although I'll have to wait a little for testers to update to is before changing my app code to support the API in iOS 18.1 - the crashes will still be my fault!) I have now also filed feedback FB15252677 😊
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to What's the correct way to check for unavailable API?
Thank you for the further information. It's good to know there's no specific availability clause I could have otherwise added. Regarding your comment: "Situations like this are exceedingly rare".... Apple increasingly likes withholding a few features from the annual iOS X.0 betas over the summer and then adding them in for RC candidates. (Who doesn't love a surprise!) This can also happen for iOS X.X releases if It coincides with a new feature from a product launch. Over the years with the existence of public betas there is greater percentage of users running beta OS versions. At the same time most major OS updates in beta through the summer have added additional beta branches (iOS 16, 17 & 18 have all added X.1 betas before X.0 was released). Beta users will blame third party apps for crashes that occur even in the post example where it's really to do with their OS "branch" for lack of a better term. Going forward it seems we do need a better way to check this availability in Swift or Apple needs to work to align beta updates of OS X.X to OS X.X+1 if that makes sense.... Otherwise this problem will reoccur with seemingly no way to avoid it. On this specific example, it's not fixed in iOS 18.1 Beta 4 or Xcode 16.1 Beta 2, but I haven't filed a feedback as it's almost impossible for it not to be fixed pre-release, many apps including the Health app would break if it wasn't.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to Swift Charts 'Pink' chart drawing issue?
Apologies, this isn't really that helpful but I've never seen this issue and I do a lot of developing with Swift Chart on WatchOS 9, 10 and 11. The only vaguely similar thing I've seen before was an issue when trying to render a SwiftUI chart as an image when it had the .chartXSelection API set for interaction. Otherwise, I'd just have a look if there's anything else fairly unique you're doing with the chart. Maybe posting some of it's code could help.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to How to detect theater mode programmatically
Unfortunately I'm 99% sure there's currently no API to detect this. I can only suggest filing feedback.
Topic: UI Frameworks SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to App not compatible with iPad model, but it is?
I've confirmed with an Apple DTS Engineer this is likely a bug. The workaround is to remove the healthkit value set for UIRequiredDeviceCapabililties in my Info.plist, hopefully this helps someone! I've since been able to update my app. Many thanks to @edford for helping here I've filed feedback FB14780645 to try and get this fixed for other users one day!
Replies
Boosts
Views
Activity
Aug ’24
Reply to SwiftCharts Not Showing Accurate Data Until Tap Gesture on Chart
One thought comes to mind which I've seen a similar issue on when using Swift Charts in a TabView. You could try setting the .id() modifier on the chart maybe with the date of the day the chart is displaying. For myself this resolved an issue where I has a Swift Chart (actually showing Health data) for each day and the wrong days were displayed sometimes when scrolling through the TabView. Hope this helps, apologies if it doesn't!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to Resting Heart Rate - Individual readings?
Are you referring to data measured by Apple Watch? If so then my understanding (as of iOS 17 & WatchOS 10) is: Apple Watch records the users Heart Rate roughly every 4-6 minutes throughout the day when on the users wrist and not in low power mode These Heart Rate readings go to 10’s per minute during a Workout Apple Watch only generates one Resting Heart Rate value per day This single Resting value is updated during the day if needed rather than additional values being saved to Apple Health To answer your question on querying the data that makes up a Resting Heart Rate value, I don’t think this is specifically possible. Essentially Apple have created an algorithm which uses the raw Heart Rate data to generate the Resting Heart Rate value, this algorithm is not public to my knowledge, and it has also changed over the years (for example, it used to incorporate all HR data throughout the day, now it ignores HR measured during Sleep). You will need to query those individual readings as you are doing with a HKHeartbeatSeriesQuery. Hope this helps!
Replies
Boosts
Views
Activity
Jul ’24