AurumRollingText
A derived numeric readout that rolls like an odometer: it waits for settleDelay of quiet before adopting a new text, then rolls only the glyphs that changed — upward when the value grew, downward when it shrank.
| family | Fields |
|---|---|
| platform | iOS 17+ · SwiftUI |
| source | Sources/Aurum/Component/Field/AurumRollingText.swift |
A derived numeric readout that rolls like an odometer: it waits for
settleDelay of quiet before adopting a new text, then rolls only the
glyphs that changed — upward when the value grew, downward when it shrank.
The quiet period is the point: while the user is still typing the value is
changing on every keystroke, and animating each intermediate value would
fight the digits being entered. Rolling once, after the pause, reads as the
field answering the user. Mirrors aurum-android's AurumRollingText.
Intended use
A derived numeric readout that a user edit changes — a converted amount, a running total, a computed gold weight. It is not a text style: pass it a value you compute, and let it decide when to roll. For static numbers use AurumText.
Do
- Feed it a fully formatted string (currency symbol, separators, unit) — it rolls only the glyphs that differ.
- Lengthen
settleDelaywhen the source is a slider or a stepper the user sweeps, so the roll answers the gesture instead of chasing it.
Don’t
- Drive it from a value that changes every frame — the settle delay never elapses and the readout never rolls.
- Use it for text that is not a number; the numeric content transition has nothing to interpolate.