↓Skip to main content
  1. Apps/

WalkSpeed

·568 words·3 mins· 0
Tool's Home Page

Overview #

WalkSpeed is an iPhone app that stops you from walking too fast. Set a speed limit, tap Start and put the phone in your pocket. It keeps measuring your speed in the background and beeps over your music whenever you go over the limit.

It is written in Swift and SwiftUI. The speed logic lives in a platform-independent Swift package with its own tests, so the calculations don’t depend on the phone.

Features #

  • Live speed on a ring gauge with a notch at your limit, in km/h or mph.
  • Alerts that say how much to slow down. One beep means you’re just over the limit, two means clearly over and three means well over. Each pattern is pitched higher than the one before.
  • Plays nicely with music. Beeps mix with whatever is playing and lower its volume for a moment. They play through headphones when they’re connected and ignore the silent switch.
  • Runs in the background with the phone locked. Location is only needed while the app is in use, and iOS shows a blue location indicator while WalkSpeed is monitoring.
  • Works indoors too. When GPS is weak or missing, the iPhone’s pedometer takes over. When both are available, they are combined.
  • No false alarms from GPS noise. Speeds are smoothed, the first beep waits until you’ve been over the limit for a moment, and alerts pause at vehicle speeds.
  • Walk history. Each walk is saved when you stop monitoring, unless it was under 30 seconds. The history lists past walks newest first, each with a small map of its route.
  • Walk summaries. Open a walk to see its route on a map, its totals and a chart of your speed against the limit. The totals are time, distance, steps, top speed, time over the limit and the number of alerts.

How it works #

  1. Core Location reports your speed about once a second. While you walk, the pedometer reports your pace every few seconds.
  2. A rolling median of the last four seconds of GPS readings smooths out spikes, and readings with poor accuracy are skipped.
  3. The smoothed GPS speed and the pedometer speed are blended, each weighted by how reliable it is. Strong GPS dominates, weak GPS defers to the pedometer, and either one carries on alone if the other drops out.
  4. An overspeed detector starts an alert once you have been over the limit for two seconds, then repeats it every five seconds until you slow down. A small hysteresis band stops it flapping when you hover right at the limit.
  5. The beeps are synthesised and played through an audio session that is only active while a beep plays, so other audio just ducks for a moment.

Requirements #

  • An iPhone running iOS 17 or later.
  • Xcode 16 or later, to build the app from source.
  • An Apple ID signed in to Xcode. A free account works, but apps it installs stop launching after seven days until they are installed again.

Building it #

Open the project in Xcode, choose your team under Signing & Capabilities, pick your iPhone and press Run.

The repository also includes a deploy script that makes a release build, installs it on a connected iPhone and launches it:

scripts/deploy.sh

The Simulator can fake a walk too, with xcrun simctl location sending a sequence of locations at a steady speed.

External Links #