Policy · Apple Health
Apple Health & HackDiet.
Apple Health fills empty days. Days you type in HackDiet are never overwritten. If Apple Health has several weights on the same day, HackDiet uses the latest one.
The contract
HackDiet's source of truth is one daily weight. Apple Health is a stream of timestamped samples that may have any number of entries per day from any number of sources. To make these two models cooperate, HackDiet follows seven simple rules:
- If you typed a value in HackDiet, it stays. Apple Health never silently replaces something you logged manually.
- Apple Health fills empty days only. When HackDiet has no weight for a given day, the latest Health sample for that day fills the gap.
- For multiple Health samples on one day, HackDiet uses the latest. Not an average. Matches what the Apple Health app shows in its "Latest" view.
- Once you edit an imported value, it becomes manual. From that point on, rule 1 protects it.
- HackDiet only writes values you created in HackDiet back to Apple Health. Imports from XML, CSV, or live Health sync never get pushed back — that would create duplicate provenance loops.
- HackDiet remembers what it wrote. When you edit or delete a HackDiet entry that synced to Health, HackDiet finds and updates (or removes) the matching Health sample. If that operation fails for any reason, your action in HackDiet still goes through — the worst case is one stale Health sample, never lost data.
- No conflict UI. The rules above are clear enough that a "resolve this conflict" screen is never needed. The Day Editor in HackDiet lets you override anything by typing a new value.
Two ways to use Apple Health
Settings › Apple Health offers two distinct actions:
- Sync with Apple Health — ongoing, both directions. New weights flow in (filling empty days), and weights you log here flow out. Asks for both Read and Write permission.
- Import history from Apple Health — one-shot, read only. Pulls existing weight history into HackDiet without enabling sync. Asks for Read permission only. Useful if you want to bring your past data over but prefer to log going forward only in HackDiet.
You can do either, both, or neither. They work independently.
Permissions
Apple lets you toggle Read and Write permission separately when HackDiet first asks. Most setups want both, but partial grants are valid:
- Read only: HackDiet pulls Apple Health data in but never writes. Sync still functions; weights you log in HackDiet just won't appear in Health.
- Write only: HackDiet pushes weights out to Health but doesn't pull anything in. The import flow won't see anything either.
- Neither: HackDiet works as a standalone tracker; Apple Health and HackDiet stay disconnected.
If you grant only one direction, HackDiet shows a brief alert explaining what's missing — nothing fails silently. To change the grant later, go to iOS Settings › Privacy & Security › Health › HackDiet.
Resetting Apple Health data
HackDiet has two distinct "data lives" on your iPhone:
- Its own database (weights, plan, history).
- Body-mass samples it wrote to Apple Health.
HackDiet › Settings › Erase all data wipes (1). The confirmation gives you two destructive options:
- Erase only — HackDiet's own data is removed. Whatever HackDiet wrote to Apple Health stays in Apple Health. Useful if you're switching to another app and want to keep your Apple Health record intact.
- Erase + clear Health — HackDiet's own data AND every body-mass sample HackDiet ever wrote to Apple Health are removed in one step. Step counts, sleep, and any other Health metrics are untouched — only HackDiet-sourced weight samples are removed.
To remove HackDiet's Apple Health data without erasing the local app: open the Health app › Sources › HackDiet › "Delete All Data from this Source." This is a feature of iOS, not HackDiet, and it leaves all other Apple Health data intact.
What happens to other Apple Health metrics
Nothing. HackDiet only reads and writes one type: Body Mass. It cannot see and cannot affect step counts, sleep, heart rate, blood pressure, nutrition, exercise, or any other metric in Apple Health.
Edge cases & known trade-offs
- Same-day weights you logged in both Apple Health and HackDiet. Rule 1 wins — HackDiet's value stays. The Apple Health entry remains in Health untouched. If you delete the HackDiet value, the Apple Health value will fill the empty day on the next sync.
- Editing a value HackDiet imported from Apple Health. Rule 4 promotes it to manual. HackDiet writes the new value back to Apple Health (creating a new HackDiet-sourced sample). The original sample HackDiet imported FROM is left alone — it belongs to whichever app or scale wrote it; HackDiet won't delete other apps' data. Apple Health's "Latest" view will show the most recent (HackDiet) value.
- Deleting a HackDiet-written sample directly in Apple Health. HackDiet doesn't observe Apple Health for deletions. The value stays in HackDiet until you also remove it there. Future versions may detect this; for now, edit or delete in both apps if you want them in sync.
- Late-night weights crossing midnight. HackDiet stores weights against UTC calendar days for cross-timezone consistency. A weigh-in shortly before or after midnight in your local time may attribute to the calendar day on either side of midnight UTC. In practice this is rarely visible; consistent morning weighing is what trend smoothing wants.
- Reinstalling HackDiet. The local database is wiped (iOS removes the app sandbox on uninstall). Anything HackDiet wrote to Apple Health stays in Apple Health (Apple's policy). If you reinstall and want your history back, use Import history from Apple Health to pull it in.