Here’s a clearer and more concise version of your question:
I’m creating an AppIntent to allow users to log their body weight. My intent includes a @Parameter defined as:
@Parameter(
title: "Weight",
description: "Current Weight",
defaultUnit: .pounds,
supportsNegativeNumbers: false
)
var weight: Measurement<UnitMass>
This works but doesn’t respect the user’s Locale and its measurementSystem. When I add defaultUnitAdjustForLocale: true
to the @Parameter
macro, the default always switches to kilograms, regardless of the locale.
How can I correctly set the default unit to match the user’s locale for the purpose of entering a users body weight?