Reputation: 2346
I'm trying to follow this screencast on building an app for Apple Watch. I've updated Xcode to 13.3, but I'm getting an error that doesn't appear in the screencast.
Cannot infer contextual base in reference to member 'fractionLength'
Cannot infer contextual base in reference to member 'numeric'
Extra argument 'numberFormat' in call
Text(
Measurement(
value: 47,
unit: UnitEnergy.kilocalories
).formatted(
.measurement(
width: .abbreviated,
usage: .workout,
numberFormat: .numeric(precision: .fractionLength(0))
)
)
)
Upvotes: 0
Views: 658
Reputation: 36119
maybe things have changed. You could try this instead:
Text(Measurement( value: 47, unit: UnitEnergy.kilocalories)
.formatted(
.measurement(
width: .abbreviated,
usage: .workout,
numberFormatStyle: .number.precision(.fractionLength(0))
)
)
)
Upvotes: 3