Finalizes the series and returns the resulting heartbeat series sample.
- iOS 13.0+
- Mac Catalyst 13.0+
- watchOS 6.0+
The completion handler called by the builder after it attempts to create and save the heartbeat series sample. The completion handler takes the following parameters:
If successful it contains the resuting sample; otherwise,
If an error occurs, this contains an object that describes the error; otherwise,
finish after inserting all the heartbeats for the series. The series builder creates the series sample, saves it to the HealthKit store, and passes it to the completion handler.
Calling this method before inserting any heartbeats results in an error. Also, calling this method invalidates the series builder; you cannot call any other series builder methods after calling this method.