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

Five stages between a number typed on a dial and a line you can act on. Each one exists to remove a specific kind of lie.
01

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.

02

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.

03

Remove the week

Weekend effects are real and predictable. Detecting weekly seasonality and subtracting it stops Monday from reading as failure.

04

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.

05

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 with a 71.0 kg trend, a month of weigh-ins under a falling trend line inside its normal-swing band, and weekly dose markers

Dashboard

Treatment tab with the next weekly dose in three days on an arc, 16 doses logged, and the last injection sites marked on a body figure

Treatment · Medication mode

Analysis with the outlook to a 70 kg goal between mid-November and early January, and a week-by-week bar chart where the trend fell in 12 of 12 weeks

Analysis · outlook

Body tab with a 24.1% body fat reading from Apple Health and a month of body composition plotted around its trend

Body · composition

Welcome screen: clay illustrations of a scale and a wavy line on tilted cards, above Welcome to Weightics

Welcome

Weekly report with the trend down 0.3 kg, seven of seven days logged, the best and worst day, and a milestone reached

Reports · weekly

Log Weigh-in sheet with the dial at 70.7 kg, the current trend, and the date and time

Weigh-in · dial

Subscription

A paywall drawn from your own trend

New installs start with a 14-day free trial of the annual plan. The paywall is plain SwiftUI: it plots the person’s own weigh-ins, lets the daily noise settle into the trend, and shows the goal date it is about to unlock.

Paywall · your own trend

Access

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.

Plans

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.

Your data

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

There is no inference server and no analytics pipeline, so there is nothing to leak. The statistics that make the app worth using are also why it never has to send anything anywhere.
Trend engine
12

Algorithms in the ensemble, EWMA and Theil-Sen among them

Projections
7 days

Forecast horizon, shipped with its confidence band

Chart ranges
8

From one week to the whole history, with pinch to zoom between them

Off device
0

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.

More case studies

A menu scanner that picks what to order, with the math done on the phone

An iOS app that reads a restaurant menu from one photo, checks it against what you logged in Apple Health today and ranks the dishes. A language model reads the menu; Swift does the math.

Read more

Language lessons from the game on your screen

Looté is an iOS app for people learning a language from the games they already play. It reads a game screen, explains each line in the context of the scene, and turns what you save into spaced-repetition flashcards.

Read more

Made to order - Bring the problem to the bench.

A rough idea is enough to start. You’ll talk directly with the person who will build it.

Bench

São Paulo