Case study: Weightics - A weight tracker that shows the trend, not the noise
An iOS app whose twelve-algorithm statistical engine (EWMA smoothing, Hampel filter, Theil-Sen slope) separates real body change from day-to-day fluctuation, entirely on device, with body composition, a GLP-1 Medication mode and widgets around it.
- Project
- Weightics
- Year
- Service
- iOS Development, Data Science & ML
Weightics
Overview
The trend under the number
Step on a scale two mornings running and it will tell you two different stories, both of them wrong. Weightics is an iOS app built on one premise: today’s number is mostly noise, and the useful figure is the trend underneath it. A twelve-algorithm engine separates the two, entirely on device.
Version 1.7 builds on that trend. Body composition comes in from Apple Health, Medication mode logs GLP-1 doses and injection sites, weekly, monthly and yearly reports sum up the change, and widgets put the trend on the Home Screen, the Lock Screen and StandBy.
- EWMA smoothing
- Hampel filter
- Theil-Sen slope
- Medication mode
- Home and Lock Screen widgets
- On-device only
The engine
From raw entry to real trend
Clean the signal
Hampel winsorization and 3σ/MAD checks catch the entries that are measurement error rather than body change: a scale on carpet, a heavy meal, a weigh-in at the wrong hour.
Smooth the trend
EWMA with an adaptive half-life, plus a Theil-Sen median slope that survives the outliers a least-squares fit would chase.
Remove the week
Weekend effects are real and predictable. Detecting weekly seasonality and subtracting it stops Monday from reading as failure.
Earn confidence
A DataPhase progression rates how far the trend can be trusted yet, so the dashboard says “Building your trend, 31%” instead of faking certainty from four entries.
Project forward
Seven-day projections ship with a confidence band, so the forecast shows its own uncertainty rather than a single confident line.
Product
The app, screen by screen
Captures of the current build running on the iOS 27 simulator, with a seeded 110-day history and Medication mode on. The recording logs a weigh-in on the dial and lands back on the Dashboard with the trend moved.
The Dashboard answers one question, Treatment keeps the dose log, and Analysis is where the statistics surface for anyone who wants them.
Weigh-in · dial to trend

Dashboard

Treatment · Medication mode

Analysis · outlook

Body · composition

Welcome

Reports · weekly

Weigh-in · dial
Subscription
A paywall drawn from your own trend
Paywall · your own trend
Earlier installs keep the free tier
The gate reads the app’s original App Store version. Anyone who installed before the subscription keeps the free tier for good, and every doubt, offline or an unreadable receipt, opens the app instead of locking it.
Prices come from the offering
Plans and prices are read from the current RevenueCat offering, so price experiments run without a release, and a remote switch can turn the gate off.
Locked never means lost
A locked app still exports every weigh-in to CSV, and nothing is deleted.
Stack & proof
The maths never leaves the phone
Algorithms in the ensemble, EWMA and Theil-Sen among them
Forecast horizon, shipped with its confidence band
From one week to the whole history, with pinch to zoom between them
Bytes of weight data leaving the phone
Technologies
- Swift
- SwiftUI
- SwiftData
- Swift Charts
- HealthKit
- WidgetKit
- App Groups
- TipKit
- Background Tasks
- RevenueCat
- Swift Testing
Swift Charts renders the trend against real weight; SwiftData keeps every entry on the iPhone, with no iCloud sync; HealthKit reads and writes body mass in the background for subscribers. The subscription runs through RevenueCat: new installs start with a 14-day free trial, and earlier installs keep the free tier.
