Post

Replies

Boosts

Views

Activity

ProgressView produces spinning wheel instead of circular ring
Hello all! Why does the classic spinning wheel ProgressView when specifying the style for the circular band/ring? Additionally, if the progressViewStyle modifier is not added to the ProgressView, a progress bar is displayed to the indicated percentage (33%) instead of the default spinning wheel. - Unless, that is I got the wrong end of the stick... ProgressView("Completed", value: 0.33) .progressViewStyle(CircularProgressViewStyle())
7
1
1.9k
Oct ’21
Why HKObjectType instead of HKQuantityType?
The requestAuthorization method in WorkoutManager wants to read HR, energy, distance and "activity" information all of which are HKQuantityTypes. //The quantity types to read from the health store let typesToRead: Set = [ HKQuantityType.quantityType(forIdentifier: .heartRate)!, HKQuantityType.quantityType(forIdentifier: .activeEnergyBurned)!, HKQuantityType.quantityType(forIdentifier: .distanceWalkingRunning)!, HKQuantityType.quantityType(forIdentifier: .distanceCycling)!, HKObjectType.activitySummaryType() ] The documentation for HKObjectType states: The HKObjectType class is an abstract class. You should never instantiate an HKObjectType object directly. Instead, you always work with one of the following concrete subclasses: ... HKQuantityType Replacing HKObjectType.activitySummaryType() with HKQuantityType.activitySummaryType() in the above code doesn't appear to cause any issues with the app. Intuitively, it should work exactly the same since HKQuantityType (being a concrete subclass of HKObjectType) inherits directly from HKObjectType. Is my understanding correct or have I missed something fundamental? If my thinking is correct, why is HKObjectType used in the sample code when all of the other set elements use the HKQuantityType subclass?
0
0
992
Jun ’21