I want to query to washing event.
but washing hand is HKCategoryType so I can't use HKStatiticsCollectionQueryDescriptor because it only accept HKQuantitySample.
is there a way that I can use it ?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
let stepType = HKQuantityType(.stepCount)
let stepsThisWeek = HKSamplePredicate.quantitySample(type: stepType, predicate: thisWeek)
let yesterday = calendar.date(byAdding: .day, value: -1, to: calendar.startOfDay(for: now))
let every5 = DateComponents(minute:5)
let healthTypes = Set([
HKCategoryType.categoryType(forIdentifier: .handwashingEvent)!
])
let sumOfStepsQuery = HKStatisticsCollectionQueryDescriptor(
predicate: stepsThisWeek,
options: .cumulativeSum,
anchorDate: endDate,
intervalComponents: every5)
do {
let updateQueue = sumOfStepsQuery.results(for: store)
// Wait for the initial results and updates.
updateQueue = Task {
for try await results in updateQueue {
// Use the statistics collection here.
}
}
} catch {
//handle error
print(error)
}
it is way above of control panel....
the code I show usdz modeling is as below
`RealityView{
content in
let entity = try! await Entity(named: "idle")
entity.setScale([0.15,0.15,0.15], relativeTo: entity)
// Enable interactions on the entity.
entity.components.set(InputTargetComponent())
entity.components.set(CollisionComponent(shapes: [.generateBox(size: [2,2,2])] ) )
content.add(entity )
}`
I'm testing code with destination sample app
but I really don't know how to add button beside of title in playbackcontrols.
I can add button with customoverlay and customInfoViewControllers but it is not like apple tv's seat change button . how can I add button ?