An iOS Lock Screen widget that shows ideal wake-up times based on 90-minute sleep cycles.
ideal wake time = now + 15 min (time to fall asleep) + N × 90 min
for N = 4, 5, 6 cycles — 6h, 7.5h, and 9h of sleep.
Glance at your Lock Screen, see when to wake up if you fell asleep right now — no app to open.
Pick any (or all) from the widget gallery on the Lock Screen:
- Ring (
.accessoryCircular) — the primary 7.5h wake time as a capacity-style ring. - Inline (
.accessoryInline) — a single-line fallback with the same primary time. - Rectangular (
.accessoryRectangular) — all three wake times (6h / 7.5h / 9h) side by side.
Time format (12h/24h) and language (English/Spanish, currently) follow your device's system settings automatically.
This isn't on the App Store — the only way to get it onto a phone is to build it from this source code. That means you need a Mac and a little comfort with Xcode. It's free (no Apple Developer Program purchase needed), but it's a "developer-ish" install, not a tap-to-download one.
- A Mac with Xcode 15+ installed (free, from the Mac App Store)
- An iPhone running iOS 16 or later, connected to the Mac by cable
- A free Apple ID signed into Xcode (Xcode → Settings → Accounts) — you don't need a paid Developer account for this
- Download the code: on this GitHub page, click Code → Download ZIP and unzip it (or
git cloneif you have git). - Open the project: double-click
SleepCalculator.xcodeproj. Xcode opens. - Point it at your own account: in Xcode's left sidebar, click the top blue project icon → for each of the two targets listed (
SleepCalculatorandSleepCalculatorWidgetExtension) → tab Signing & Capabilities → under Team, pick your own Apple ID from the dropdown (not the one already selected — that belongs to someone else's account and won't work for you).- If Xcode shows a red error about the bundle identifier already being in use, change the text field just above Team (it starts with
ProdCaro.) to start with something unique to you instead, for both targets.
- If Xcode shows a red error about the bundle identifier already being in use, change the text field just above Team (it starts with
- Plug in your iPhone, unlock it, and tap Trust if it asks about this computer.
- At the top of the Xcode window, click the device dropdown (it may say "Any iOS Device" or show a simulator name) and select your iPhone from the list.
- Press the ▶ Run button (or ⌘R). Xcode installs the app on your phone.
- If your phone shows an "Untrusted Developer" alert, or Xcode asks you to enable Developer Mode: on the iPhone go to Settings → Privacy & Security → Developer Mode, turn it on, let it restart, then run again.
- Add the widget: on the iPhone, long-press an empty part of the Lock Screen → Customize → tap a widget slot → search "Sleep Calculator" → choose the ring, rectangle, or inline style.
That's it — the app itself doesn't need to be opened again after this; the widget keeps working on its own.
- "Communication with Apple failed: your team has no devices registered" — this can happen the first time you connect a new phone. Unlock the phone, make sure it's trusted, and try Run again; Xcode usually registers it automatically on the second attempt.
- Widget doesn't show up in the gallery — make sure you ran the
SleepCalculatorapp scheme (not the widget extension scheme) at least once, and that the build finished without errors.
MIT — see LICENSE.