init(recordTypes:sourceTypes:predicate:resultsHandler:)
Creates a query for one-time access to a verifiable clinical record.
Declaration
init(recordTypes: [String], sourceTypes: [HKVerifiableClinicalRecordSourceType], predicate: NSPredicate?, resultsHandler: @escaping @Sendable (HKVerifiableClinicalRecordQuery, [HKVerifiableClinicalRecord]?, (any Error)?) -> Void)Parameters
- recordTypes:
The types of records that this query returns. For a list of valid record types, see Hkverifiableclinicalrecordcredentialtype.
- sourceTypes:
The format of the verifiable clinical records. For a list of valid sources, see Hkverifiableclinicalrecordsourcetype.
- predicate:
A predicate that limits the results that this query returns. Pass
nilto receive all records of the specified source and record type. - resultsHandler:
A block that the HealthKit store calls after it finishes executing the query.
This block takes the following parameters:
queryA reference to the query that called this block.
recordsAn array containing the verifiable health records found by the query, or
nilif an error occurs.errorIf an error occurs, an object describing the error; otherwise, it’s
nil.