how to read and write HKWorkoutRoute

Hi,

Im pretty new to swift so bare with me. Im trying to record the route during a run or walk. Ive followed the tutorial on apple's website, but im stuck because no matter what i do, the routeBuilder is always showing up with errors. Any help is appreciated

Thanks

https://developer.apple.com/documentation/healthkit/workouts_and_activity_rings/creating_a_workout_route