Personal finance apps show totals and categories, but they rarely reveal what changed and why. Which days broke the pattern? How are spending habits shifting week to week? Answering these questions requires outlier detection, percentage normalization, and downsampling.
This demo uses Quiver to build
a spending dashboard entirely on-device. groupedData(by:using: .percentage)
shows where money goes. downsample(factor:using:) converts 30 days
into weekly summaries. outlierMask() flags the days that broke the
pattern. All computation runs on Swift arrays — no server, no bridge,
no third-party analytics SDK.
- Clone this repo
- Open in Xcode 26
- Run on the iOS simulator
This Month — Total spend, daily average, daily spread, and
month-over-month percentage change computed with sum(), mean(),
standardDeviation(), and percentChange(lag:). Every headline
number shows up with the spread next to it — the daily mean alone
hides whether spending is steady or volatile.
Where It Goes — Donut chart of spending by category, powered by
groupedData(by:using: .percentage) — one call aggregates and normalizes.
Weekly Breakdown — Bar chart of weekly spending totals computed by
downsample(factor:using:) — one call chunks 30 days into 5 weeks.
Unusual Days — Scatter chart highlighting outlier spending days
detected by outlierMask() with dollar annotations on each flagged
day. The subtitle shows the live derivation — mean, standard
deviation, and the actual dollar cutoff — so the 1.5-threshold
becomes a visible computation rather than a black box.
sum()/mean()— monthly total and daily averagestandardDeviation()/standardError()— daily spread and confidence in the meanpercentChange(lag:)— month-over-month spending changegroupedData(by:using: .percentage)— category shares normalized to 100%downsample(factor:using:)— chunk daily data into weekly summariesoutlierMask()— z-score flagging of unusual spending daysmaskedWithIndices(by:)— extract flagged days with their positions
- Quiver — the framework
- Quiver Cookbook — 41 interactive recipes
- Quiver Documentation — API reference and conceptual guides
- Swift Algorithms & Data Structures — the companion book