Post

Replies

Boosts

Views

Activity

Bug in tutorial concerning displayName?
Hi there, Thanks for the great tutorial for WorkoutKit, that can be found here: https://developer.apple.com/videos/play/wwdc2023/10016/ In my view Text(scheduledWorkout.plan.workout.activity.displayName) in SamplePlannerView.swift (the main view) does not show the correct string. For example for the running workout, it should show: "New Running Workout". This string is set in WorkoutStore.swift. However, it shows "Outdoor Running", which is the type of workout but not the display name that was given to it. Best regards, Patrick
0
0
588
Sep ’23
Convert from Fahrenheit to Celsius?
Hello Everyone, In the example code, I'm trying to convert from Fahrenheit to Celsius, but I'm not succeeding. Output is always in Fahrenheit. My code is this:   func formattedTemperature(_ temp: Measurement<UnitTemperature>) -> String {         let tempC = temp.converted(to: .celsius)         return tempC.formatted(.measurement(width: .abbreviated, usage: .weather))     } In the simulator I also went into the settings and switched in General->Language/Region from F to C. But this also had not effect. Would anyone have an idea how to correct this? Thanks and best regards, Patrick
1
0
1.5k
Jun ’22