Manual HealthKit samples entered by the user will be set to YES for the HKMetadataKeyWasUserEntered metadata HKMetadataKeyWasUserEntered . To create a predicate that matches only patterns that were not entered, you can use the following:
[NSPredicate predicateWithFormat:@"metadata.%K != YES", HKMetadataKeyWasUserEntered];
Note that this should be stated as value != YES , because the value for the key can be YES, NO, or nil, and nil means NO.
source share