RUC tracking app for multiple vehicles
I built the MVP you described.
What you can do now
- Add one or more cars by plate.
- For each car, set the RUC expiry odometer (km).
- Add odometer readings over time.
- See, on the home screen, each car’s latest odometer and a projection to RUC expiry:
- If there’s enough history, it shows estimated days left and date.
- Otherwise it shows km remaining to expiry.
How it works
- Data model: Models.swift
Car:plate,expiryOdometer,entries: [OdometerEntry]- Projection uses average km/day from the last 30 days (falls back to all entries if fewer than 2 recent) to estimate days remaining and the projected expiry date.
- Persistence: CarStore.swift
- Simple JSON file in the app’s Documents directory. Auto-saves on changes.
- UI:
- App entry: RUCBuddyApp.swift provides a
CarStoreand shows the list. - Views: Views.swift
CarListView: home screen with list, add button, and per-car projections.AddCarView: add a car with plate and RUC expiry odometer (km).CarDetailView: summary, add reading (date + odometer km), history, and edit expiry odometer.
- App entry: RUCBuddyApp.swift provides a
Notes
- Units are km.
- “RUC expiry odometer” means the odometer value at which your current RUC block ends. Distance left =
expiryOdometer - latestOdometer.
Next improvements (tell me what you want and I’ll add):
- Store “license size” and “odometer at purchase” instead of raw expiry, so the app computes
expiryOdometerautomatically. - Better input helpers (e.g., numeric toolbar), validation, notifications when near expiry, iCloud sync, widgets, etc.
Would you prefer entering RUC blocks as “km purchased” + “odometer at purchase” instead of the direct “expiry odometer”?
Got it. The app already uses only the expiry odometer.
Want any tweaks?
- Warning threshold: show “Due soon” when fewer than N km or days remain. What threshold do you want?
- Sorting/formatting: group cars by “due soon,” color badges, or show both
km leftand~days. - Deployment target: I can lower the iOS target (currently 18.5) to silence warnings. What minimum iOS version do you want? (e.g., 16.0 or 17.0)
If you’re happy as-is, I can add a small “Settings” row per car to quickly bump the expiry odometer when you buy more RUC.
Done.
What changed
- Add car: You now enter an initial odometer reading (and date) when creating a car. It creates the first history entry.
- See Views.swift.
- Quick bump: In the car detail screen, there are quick actions to bump the expiry odometer by
+1000 kmor+5000 kmwithout entering edit mode.- See Views.swift.
- Due soon styling: The list highlights soon-to-expire cars:
- Orange if
<= 500 kmleft, or if projected<= 7 days. - See Views.swift.
- Orange if
Validation
- Add Car form requires: plate, initial odometer >= 0 and less than the expiry odometer, and expiry > 0.
Build status
- Built successfully. One warning about deployment target (project is set to iOS 18.5; current SDK supports up to 18.2).
Want me to:
- Adjust the quick bump sizes or thresholds?
- Lower the iOS deployment target (e.g., 17.0) to remove the warning? If yes, tell me your minimum iOS version and I’ll update the project.
Thanks for the heads-up. That’s likely the Form row treating the two inline buttons oddly and both actions firing. I’ve changed “Quick bump” to a single Menu so only one action executes per tap.
What I changed
- Replaced the two inline buttons with a menu:
- Tap “Add” → choose
+1,000 kmor+5,000 km - See Views.swift
- Tap “Add” → choose
This should eliminate the random multi-increment. Try it now and tell me if it behaves correctly. If you prefer, I can make it a Stepper (e.g., step 1,000) or keep both preset amounts in separate rows.
Done. The quick bump menu now shows only the plus icon.
Where to see it
If you’d like, I can switch the icon to plus.circle.fill or add a tint.
Done. On the car detail screen, RUC settings now appears above History.
Changed in Views.swift and the History section follows it at Views.swift.
Want me to tweak anything else on that screen (e.g., collapse History by default, show last 3 with a “See all”)?
Great call.
I’ve:
- Committed a checkpoint with everything so far.
- Implemented History collapse (shows last 3 readings by default with a Show all/Show less toggle).
- Committed that change too.
Commits
- Checkpoint: add RUC tracking MVP
- Detail: collapse History by default, show last 3 readings with Show all/Show less toggle
Code reference
- History toggle in Views.swift
- Car detail state for the toggle in Views.swift
Want me to:
- Add a disclosure chevron for History instead of a button?
- Sort car list by soonest-to-expire?
Sorted by soonest-to-expire and committed.
What I changed
- Car list now orders cars by:
- Expired first
- Then by projected days remaining (ascending)
- Then by km remaining
- Tie-breaker: plate
Code
- Sort logic in CarStore.swift
Commits
- Sort car list by soonest-to-expire (expired first, then projected days, then km remaining)
Anything else you want to adjust about the sort (e.g., always show km left next to the days on the list)?
Remote added and pushed.
What I ran
- Added remote:
git remote add origin git@github.com:nicwise/RUCBuddy.git - Pulled with rebase to integrate remote
main:git pull --rebase origin main - Pushed
mainand set upstream:git push -u origin main
Your GitHub repo nicwise/RUCBuddy now has the latest commits.
Added the screenshots and pushed.
- Added:
shots/1-homepage.pngshots/2-ViewCar.pngshots/3-QuickAdd.pngshots/4-NewCar.png
README already references them at shots/....