predicateForElectrocardiograms(symptomsStatus:)
Returns a predicate that matches electrocardiogram samples with the specified symptom status.
Declaration
class func predicateForElectrocardiograms(symptomsStatus: HKElectrocardiogram.SymptomsStatus) -> NSPredicateParameters
- symptomsStatus:
The target symptom status.
Return Value
A predicate that matches electrocardiogram samples with the specified symptom status.
Discussion
Use this convenience method to create a predicate that matches electrocardiogram samples with the specified symptom status. The following sample uses both the convenience method and a predicate format string to create equivalent predicates.
let forSymptomStatus = HKQuery.predicateForElectrocardiograms(symptomsStatus: .present)
let status = HKElectrocardiogram.SymptomsStatus.present.rawValue
let explicitForSymptomStatus = NSPredicate(format: "%K == %d", HKPredicateKeyPathECGSymptomsStatus, status)