What’s the recommended way to determine whether HealthKit data is being accessed on an iPad versus an iPhone?
My goal isn’t really to identify the device type itself, but to know whether the HealthKit data is likely being viewed on the device where it was originally recorded, or on a device that receives the data via HealthKit/iCloud syncing. This matters because synced HealthKit data can appear with a delay, and I’d like to set appropriate expectations for users.
I previously used UITraitCollection.current.userInterfaceIdiom == .pad as a proxy for this, but that API is being deprecated. Is there a better way to distinguish between locally recorded HealthKit data and data that has arrived via sync, or otherwise identify when the app is running on an iPad?
Thanks for additional clarification. At the moment, all the information about the source device is going stored via the HKSource for the object. If you'd like to continue checking for the app running on iPad, the system APIs will be your best source of information: https://developer.apple.com/documentation/uikit/uidevice/model?language=objc
That being said, if you'd like to see this sort of information being provided on the sample, we'd encourage filing a Feedback Request to build something to fit your needs.