Air Quality: a SwiftPieces remix in SwiftUI, inspired by Paku
An air quality app in seven screens across three tabs on a floating dock, in the SwiftPieces look, light or dark; actions are pills, sheets and cards 28, tiles 18, and colour comes from the data: the US EPA scale on every pin, badge and bar, with indigo for the app's own switches and selection. The map opens under a two-weight header that says how the air is, a glass segment to switch between AQI, temperature, humidity and PM2.5, and sensors as numbered pins in their EPA colour; the selected one waits on a glass sheet with its reading in a round badge, how fresh and how far, a star to save it and a legend of the scale. A sensor pushes in on one glowing number and where it sits on the scale, the last 24 hours as bars that turn from amber to red as the air worsens, the EPA's advice for sensitive groups and everyone else, and temperature, humidity and PM2.5 with their trends. History compares the week's daily highs with last week and lets you drag through today's PM2.5. Nearby leads with the closest sensor, then the rest and your favourites as badges with trend arrows; Alerts sets the category that warns you, what happens when it clears and the sensors you watch, with a test alert; widgets show the Lock Screen, a Live Activity and a tile coloured by its reading; a sheet picks data sources and corrections. Built from Screen Header, Glass Segments, Place Map, Tint Panel, Avatar, Reaction Toggle, Tag, Elastic Button, Glow Number, Step Trail, Category Bars, Stat Grid, Compare Line, Area Scrub, Switch, List Row, Swipe Action Row, Toast, Bar Chart, Motion Card, Picker, Decimal Stepper and Commit Button.
- Tap a pin on the map, then save the sensor with the star
- Open Sensor details and drag across the 24-hour bars
- Open History and drag through today's PM2.5
- Switch to Nearby and open the closest sensor
- On Alerts, pick Unhealthy and send a test alert
- Tilt the Good widget
- Tabs: Each tab keeps its own place, so switching back returns you where you were.
- Push: The next screen slides in from the trailing edge; back slides it away.
- Sheet: The sheet rises over the screen, rests at its detents and follows your drag to dismiss.
- Tap: A tap acts on release, so dragging off cancels it.
- Drag: It tracks 1:1 under your finger and settles with a spring when released.
- Scrub: Values change continuously under your finger, with a tick at each step.
- Select: The selection moves between options instead of blinking.
- Swipe: It follows your finger, then commits or springs home based on distance and speed.
- Toggle: The state changes at once and the control animates to match.
- Haptic: A short tap of vibration confirms the moment something happens.
- Spring: Motion overshoots slightly and settles, the way physical things do.