I can't compile my mac catalyst app with the new SwiftUI life cycle on Big Sur with the final Xcode 12 release. The deployment targets for Big Sur are missing. This issue isn't present in Beta 6.
Post
Replies
Boosts
Views
Activity
Why doesn’t deinit support async? At the end of a test, I want to wipe data from HealthKit, and it’s delete function is asynchronous.
Does Swift Testing support using ‘any’ values as parameters like seen here for ‘any ChartDataPoint.Type’
@Test(arguments: [
(expectedBodyFatValues,
HKQuantityTypeIdentifier.bodyFatPercentage,
HKUnit.percent(),
BodyFatPoint.self),
(expectedActiveEnergyValues,
HKQuantityTypeIdentifier.activeEnergyBurned,
HKUnit.kilocalorie(),
ActiveCaloriesPoint.self),
(expectedBodyMassValues,
HKQuantityTypeIdentifier.bodyMass,
HKUnit.pound(),
BodyMassPoint.self),
(expectedBasalEnergyValues,
HKQuantityTypeIdentifier.basalEnergyBurned,
HKUnit.kilocalorie(),
BasalEnergyPoint.self)
])
func healthKitDataReading(
expectedData: [Double],
identifier: HKQuantityTypeIdentifier,
unit: HKUnit,
dataChartType: any ChartDataPoint.Type
) async throws {...}
Currently I can’t get this code to work, and see the error
… Conflicting arguments to generic parameter 'C' ('[([Double], HKQuantityTypeIdentifier, HKUnit, BodyFatPoint.Type)]' vs. '[([Double], HKQuantityTypeIdentifier, HKUnit, ActiveCaloriesPoint.Type)]' vs. '[([Double], HKQuantityTypeIdentifier, HKUnit, BodyMassPoint.Type)]' vs. '[([Double], HKQuantityTypeIdentifier, HKUnit, BasalEnergyPoint.Type)]')
Also, I can’t seem to use variables like ‘expectedBodyFatValues’ due to the error
Instance member 'expectedBodyFatValues' cannot be used on type 'Health_Mix_Swift_Tests'; did you mean to use a value of this type instead?
Only way I’ve found around this is including the entire array of values as the parameter, but it’s very cumbersome.