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