Is it possible to detect the resource of the step count on HealthKit on iOS?

Viewed 132

There are 2 ways to get step count on iPhone. The first is from actual walking, then iPhone detects the steps. The second one is that a user manually add step data.

Is it possible to find out on HealthKit that the steps come from iPhone but not from a user input?

1 Answers
let pred = NSPredicate(format: "metadata.%K != YES", HKMetadataKeyWasUserEntered)

Applying above predicate should help.

In case of objective - C

[NSPredicate predicateWithFormat:@"metadata.%K != YES", HKMetadataKeyWasUserEntered];
Related