Not able to build the sample code

I'm using Xcode Version 15.0 beta (15A5160n) and getting the following error:

Value of type 'HKWorkoutSession' has no member 'sendToRemoteWorkoutSession'

Any idea what's causing this? I pulled the code from https://developer.apple.com/videos/play/wwdc2023/10023/

Answered by DTS Engineer in 762678022

There was an error in the function name in the first beta release of the SDK, and the WWDC video is based on that version. The error has been corrected in later beta releases.

You should be able to resolve the issue by upgrading to the latest Xcode beta version, and then adjusting your code to use the corrected function name, which is sendToRemoteWorkoutSession(data:) { … }, as shown in the documentation that Claude linked to.

Could you please show code (sorry, we have no time to find what you extracted from a 30 minutes video) ?

Did you check documentation: https://developer.apple.com/documentation/healthkit/hkworkoutsession/4126899-sendtoremoteworkoutsession

Apologies, maybe I wasn’t clear. I’m trying to say that the code sample posted from the session doesn’t build. I didn’t write the code, simply trying to run what was provided from the session link and getting a couple failures.

Accepted Answer

There was an error in the function name in the first beta release of the SDK, and the WWDC video is based on that version. The error has been corrected in later beta releases.

You should be able to resolve the issue by upgrading to the latest Xcode beta version, and then adjusting your code to use the corrected function name, which is sendToRemoteWorkoutSession(data:) { … }, as shown in the documentation that Claude linked to.

Not able to build the sample code
 
 
Q