Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

How to export workout plan as JSON?

Hi guys,

In WWDC23 session 10016: Build custom workouts with WorkoutKit , the presenters mentioned that a Workout Plan can be exported to a JSON or binary file, and also showed a code snip:

let binaryRepresentation = try myCyclingWorkout.dataRepresentation(in: .compactBinary)

However in the current SDK, the property dataRepresentation can not be exported with a specific format, the base64EncodedString() result is unreadable.

Does anyone know how to export it as a JSON string now? Thanks very much.

How to export workout plan as JSON?
 
 
Q