Instance Method

earliestPermittedSampleDate()

Returns the earliest date permitted for samples.

Declaration

func earliestPermittedSampleDate() -> Date

Return Value

The earliest date that samples can use. You cannot save or query samples prior to this date.

Discussion

Attempts to save samples earlier than this date fail with an errorInvalidArgument error. Attempts to query samples before this date return samples after this date.

See Also

Working with HealthKit Objects

func delete(HKObject, withCompletion: (Bool, Error?) -> Void)

Deletes the specified object from the HealthKit store.

func delete([HKObject], withCompletion: (Bool, Error?) -> Void)

Deletes the specified objects from the HealthKit store.

func deleteObjects(of: HKObjectType, predicate: NSPredicate, withCompletion: (Bool, Int, Error?) -> Void)

Deletes objects saved by this application that match the provided type and predicate.

func save(HKObject, withCompletion: (Bool, Error?) -> Void)

Saves the provided object to the HealthKit store.

func save([HKObject], withCompletion: (Bool, Error?) -> Void)

Saves an array of objects to the HealthKit store.