London Tube departures on your Home Screen and Lock Screen — TubeNext shows the next train for your commute and automatically switches between your outbound and return direction based on the time of day.
- Xcode 16+
- iOS 17+ (required for the AppIntents-powered widget buttons)
- Open
TubeNext.xcodeprojin Xcode. - For each target (
TubeNext,TubeWidgetExtension,TubeNextTests), set your own Development Team and change the Bundle Identifier — the project ships with the original author's team ID and bundle IDs, which will not let you sign the app. Xcode's "Automatically manage signing" will handle provisioning once these are set. - Make sure the App Group
group.tubenext(or your own renamed group — see below) is enabled under Signing & Capabilities for both the app and the widget extension targets, and that it's registered on your Apple Developer account. - Build and run (
Cmd+R). To see the widget, add it from the Home Screen or Lock Screen widget gallery after installing the app once.
TubeNext ships with example commute presets — real TfL stations, but not the
maintainer's actual route. Edit Shared/Presets.swift to point at your own
stations:
stopPointId— the TfL NaptanID for your station (e.g.940GZZLULVTfor Liverpool Street). Look these up via the TfL Unified API (https://api.tfl.gov.uk/StopPoint/Search/<name>).lineId— the TfL line id (circle,central, etc).directionFilter/platformFilter— how arrivals are filtered to your direction of travel. TfL'sdirectionfield (inbound/outbound) is more reliable than matching on platform name, but conventions vary by station — check the live Arrivals API for your own stops before relying on either.windowStartHour/windowEndHour— the time window during which this preset is active.
If you want location-based auto-switching between two lines (see
Commutes in the same file), update the Station coordinates for your own
detection stations as well.
TubeNext is a SwiftUI app plus a WidgetKit extension, sharing code through a
Shared/ folder synced into both targets. The app and widget communicate
through an App Group (UserDefaults suite), and both talk directly to the
public TfL Unified API — there are no third-party dependencies. See
docs/ARCHITECTURE.md for the full breakdown (data
flow, module responsibilities, and design decisions).
MIT — see LICENSE.
TubeNext 是一个 iOS 通勤助手:在桌面小组件或锁屏上直接显示伦敦地铁下一班车还有几分钟,
并按当前时间自动判断该显示"去程"还是"回程"方向,不用每次打开 App 手动切换。项目只用
SwiftUI + WidgetKit + App Group + TfL 官方 API,没有第三方依赖。仓库里的通勤路线是示例
站点,不是作者的真实路线——用自己的通勤时编辑 Shared/Presets.swift 换成你自己的站点即可。
构建前需要把签名换成你自己的 Apple Developer Team 和 Bundle ID。