Next Turn: Co-Pilot
How I built an iPhone and Apple CarPlay co-driver that calls every corner before you see it, works offline, and keeps your data on your phone.
, 14 min read


Free on the App Store
Next Turn: Co-Driver
Pace notes and directions in one voice, before you see the corner.
Scan with your camera to open the App Store, or share the code with someone who drives.
Contents
A sat-nav tells you where to turn. Next Turn tells you what the road is about to do.
On a road you don’t know, that is the part that matters: the corner that tightens after a crest, the square right hidden behind a hedge, the long straight that is about to end.
Next Turn is my answer to that. It is a co-driver in your phone. It reads the road ahead and says each corner out loud before you can see it, the way a rally co-driver reads pace notes: “70 left tight into right square.” Mount the phone, listen, and keep your eyes on the road.
I built it end to end: the pace-note engine, the SwiftUI iPhone app, the CarPlay app, the offline map pipeline, the co-driver voices, the small server for road alerts, and the App Store release. It is live on the App Store in the UK as Next Turn: Co-Driver, free, with no ads and no account.
Why a co-driver?#
A rally co-driver does not tell the driver where to go. They describe the road: the direction, the severity, the length, what comes next. The driver supplies the speed and the judgement. That division of labour is why a good co-driver can make an unfamiliar road feel familiar.
Most of us do not have a co-driver. We have a sat-nav that says “turn left in 300 yards” and then goes quiet while the road does something much more interesting. The information is already in the map: the shape of the road, the junctions, the bends. It just was not being spoken in a way a driver could use.
Next Turn turns that geometry into pace notes. It is not a racing app and it does not tell you how fast to go. It describes the road, so you can decide what to do about it.
The screen is for a passenger. The drive is audio-first.
What it does#
There are two ways in. Road works on any road built from OpenStreetMap: search for a destination, choose one of up to three routes, and Next Turn downloads only the map the trip needs. Or tap Just drive with no destination, and it predicts the road you are on and calls the corners ahead.
- Where to? searches offline road and town names first, then Apple’s places and addresses when there is signal.
- Offline maps are built from Next Turn’s own UK tiles, published as releases of a public map repository, so the app does not depend on a public map server.
- The map extends while you drive: when the road ahead leaves the downloaded area, the app fetches the next box, merges it and carries on without a gap.
- Road and weather alerts bring in National Highways closures, TomTom incidents, TfL disruptions and Met Office warnings, said once before you reach them.
- Speed limits come from the map, with a confirmed sign or an honest guess, and an optional warning when you go over.
Track is the other side: record a road once with GPS, gyroscope and barometer, and the app builds a roadbook from your own run. That is the most precise set of notes you can get, because they come from the line you actually drove. It is built and tested, but I have parked it in the app while Road mode gets the real-world miles. It will come back when it has had enough work.
The app, screen by screen
Eight iPhone stills from the build: planning and downloading a drive, the two drive layouts, the end of a drive, the voice settings, the parked Track mode and the state when the GPS fix goes.
Select any image to view it larger.
The drive screen#
With a destination, the screen splits into two jobs. The top is sat-nav: a blue instruction banner with the arrow, the distance, the turn and the street. The bottom is the co-driver: the last call in big condensed capitals, its pacenote sign, and the next call with its distance. The map sits in between as context, never the main event.
That split is deliberate. Blue is where to turn. Orange is what the road does. One instruction at a time, so the turn and the corner never talk over each other.
What you hear is a choice, not a surprise:
| What's spoken | What you hear |
|---|---|
| Co-driver | Pace notes for every corner ahead |
| Directions | Turn-by-turn only; needs a destination |
| Directions + co-driver | Pace notes on the road, directions at the junction |
| Alerts only | GPS lost or back, new route, map ending, destination reached |
| Mute | Nothing |
Two co-driver voices, Daniel and Alice, are generated with ElevenLabs and built into the app, so they work offline. Each pack is made once from the engine’s own vocabulary and cached by content hash; if a pack lacks a word, the whole call falls back to an iPhone voice rather than mixing two speakers mid-sentence.
On the car screen#
Next Turn is also a CarPlay navigation app. It shares the iPhone’s state, so a drive started on either screen appears on both, and the same co-driver voice comes through the car speakers. The car side gets the map, Where to?, Places, Just drive, route previews, turn-by-turn maneuvers or the next pace note with its sign, the speed and limit chip, Report, and the arrival summary. It works with the iPhone locked.
CarPlay has its own rulebook, and I designed to it rather than around it. The base view is a map. Every button, panel, alert and list is a CarPlay template. The maneuver panel only ever contains maneuvers; the co-driver’s sign sits on the map at the corner instead. Nothing asks the driver to pick up the iPhone. The app is built and running in Apple’s CarPlay Simulator, and the navigation entitlement was granted in December 2026. It is not in the current App Store build yet: a real car test and the next release are the remaining steps.
On the car screen
Two CarPlay stills from the demo drive: the navigation panel with the co-driver’s sign on the map, and the five listening modes on the car screen.
One engine, three homes#
The heart of Next Turn is a TypeScript engine that compiles to a single JavaScript file with no runtime dependencies. The iPhone runs that file inside JavaScriptCore, with JSON in and JSON out. The same file runs in Node and in a browser. There is no second implementation to drift.
The engine takes a recorded track or a road graph and produces structured notes. Projection to metres, stop collapsing, thinning, gap detection, resampling, noise estimation, adaptive smoothing, curvature, corner detection with hysteresis, circle-fit radius, severity grades, length classes, tighten and open shapes, “into” and “and” links, confidence per note. It also handles crests and dips from the barometer, jumps from the accelerometer, and a gyroscope and GPS fusion that draws the corner between fixes and bridges GPS gaps.
Every note is a defined format, RNP1: a strict, canonical text line that can be parsed and serialised. That matters because it gives the rest of the system something checkable to work with. The parser is strict, and a 3,000-case round-trip property test makes sure nothing is lost between the engine, the app and the tests.
RNP1 IN_M:175 TURN_L SEV:3 R_M:40 ANG_DEG:90 LEN_M:73 CONF:100 STATUS:OK
"150 left medium"
"120 right fast"
"30 right hairpin"Deterministic by rule#
The engine is not allowed to use clocks, randomness, the network, timers, console, locale APIs or the DOM. All timestamps come from the input data. A static guard test enforces it. Every threshold decision is quantised before it is compared, and transcendental math is treated as a last-bit risk rather than a convenience.
The result is that the same input produces byte-identical output on V8, on Apple’s JavaScriptCore, on macOS and in the iOS Simulator. Golden fixtures fail the build if that ever stops being true. Config and requests are strict too: a misspelled key is an error, never silently replaced by a default, and every result carries a reproducible config hash.
A co-driver that gives a different answer on a different engine is not a co-driver.
Maps that live on the phone#
Offline-first is a product decision, but it is also a map pipeline. The UK is cut into tiles of about 11 by 7 km, built from free OpenStreetMap extracts, packed into releases, and published as a public map repository. The app reads an index, fetches only the tiles it needs with HTTP range requests, unzips them and joins them with the engine’s own merge. A joined set of tiles is identical to one download of the same area.
Being offline is not enough; the app has to know where you are. A hidden Markov model matches GPS to the road graph, respects one-ways, refuses to jump to a parallel road or a bridge, and handles roundabouts. Routing by typical travel time, pace notes from map geometry, turn-by-turn directions and the drive session all come from the same graph.
On a real OpenStreetMap network in Mdina, with 5 m of synthetic GPS noise, the matcher chose the right road 98% of the time. Fusing the gyroscope with 1 Hz GPS raised same-grade corner calls from 36% to 90% on synthetic drives. Those numbers are from benchmarks, not marketing: they are in the repository with the tests that produce them.
Hearing the road, not reading it#
A call is only useful if it arrives in time. The engine works backwards from the corner, the length of the spoken clip, the driver’s reaction and a gentle braking assumption. It will drop a call rather than speak it after the corner. It never queues two calls on top of each other.
There are two call styles. Everyday is the default: plain words, no distances, what to do first and what is coming next. Detailed is the rally legend: hairpin, very tight, tight, medium, open, fast, very fast, flat, with plus and minus, short and long, tightens and opens, late. Both are generated by the same engine, so switching style never changes the underlying road.
And because silence is its own kind of failure, a long straight gets a call too. The app would rather tell you the road is straight than leave you wondering whether it has stopped working.
The road, in pictures
The signs the engine draws, a limit change said before the sign, and the drive screen in two real driving contexts.
The parts that were hard#
- The last bit of determinism. Most code is deterministic by accident. This code has to be deterministic on purpose: every rounding decision, every threshold, every comparison, across two JavaScript engines.
- Owning the map data. Building and publishing the tiles meant owning the import, the packing, the merging and the licence credit. It is more work than calling a map API, and it is why the app works in a valley with no signal.
- Call timing. A late call is worse than no call. The speech queue has deadlines, drops calls it cannot finish, and logs why. That is not a feature you can see; it is the feature.
- CarPlay compliance. Templates, a map-only base view, maneuvers only in the maneuver panel, no asking for the phone, no speed advice. The constraints made the design better.
- App Review. The app was rejected under guideline 2.5.4 because background location and audio are hard to demonstrate at a desk. The answer was a demo drive through the real drive screen, plus a desk recording showing the calls continuing with the phone locked.
What the real drives caught#
The app has a flight recorder. Every GPS reading, every engine input and answer, every call queued, dropped, cut or heard, every map and audio event, and a heartbeat every five seconds. A driver can mark a bad moment with one tap and say what went wrong. The logs stay on the phone, and the driver chooses whether to share them.
That is how the product got better after the simulator was done:
- On a real drive, a left turn sounded like “go right” because the co-driver’s chain ran into the sat-nav instruction. The engine now gives the corner before the maneuver its own part, and Directions + co-driver says only the corner while the turn is left to the directions. A regression test was built from the same junction shape.
- A green traffic line appeared from the car after a re-route. The line was being trimmed from an already-trimmed line. Replaying the drive log found it 100 times, up to 1.9 km long; the fix leaves one moment, three seconds before a refresh.
- With music playing over CarPlay, iOS asked for short prompts and 29 calls became a tone, including turn instructions. The words are now spoken over ducked music. A tone is not a co-driver.
- A speed-limit change was being said at the sign, not before it. The engine now sends the next limit up to 500 m ahead and the app says it about six seconds early, once, with the direction of the change.
None of those would have come out of a simulator. The simulator builds the product; the drive log makes it trustworthy.
Privacy is a product decision#
There is no account, no advertising, no analytics and no third-party tracking SDK. Apple’s privacy label says Data Not Collected. Position, routes, maps and drive logs stay on the phone until the driver chooses to share them.
The app goes online only for map downloads, Apple’s place search and routes, and road alerts. The small server exists to hold provider keys that must not ship in the app: National Highways closures and TomTom incidents. For TomTom, only the rough map squares of the route are sent. The server never sees a position. The best privacy policy is the one you do not need to read.
Where it is now#
Next Turn is live on the App Store in the UK, free, with no ads and no account. Everyone who joined during the beta keeps it free for good. It is a solo build: the engine, the iPhone app, the CarPlay app, the map pipeline, the server, the voices and the App Store submission.
The next chapter is more real-world miles: numbered pace-note styles alongside the descriptive ones, CarPlay in a real car and in the release build, and Track mode back on when it has had enough work to earn its place.
If you drive roads you don’t know, and you have ever wanted someone in the passenger seat who has already seen the next corner, this is for you. Next Turn: Co-Driver is free on the App Store in the UK, with no ads and no account.
Topics: iOS, SwiftUI, TypeScript, Apple CarPlay, OpenStreetMap, Offline-first, Product engineering
