Conversation
`textStyle: 'minutes'` renders a live-updating countdown or count-up without seconds (e.g. "19 minutes") using SwiftUI's `SystemFormatStyle.DateOffset`. It requires iOS 18 and falls back to the default timer style on earlier versions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Titozzz
marked this pull request as draft
September 29, 2026 14:46
Author
|
Closing for now, will reopen if needed, sorry for the noise ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this?
Timergets a newtextStyle: 'minutes'option. It shows a live countdown or count-up without seconds, for example "19 minutes" instead of19:42. Seconds are often noise in Live Activities that track something on the scale of minutes or hours, such as a shift or an appointment starting soon. Until now, the only live-updating styles ('timer'and'relative') both showed seconds.How does it work?
On iOS 18 and later, the timer renders
Text(.currentDate, format: .offset(to:allowedFields:sign:)). This is SwiftUI'sSystemFormatStyle.DateOffset, which the system keeps up to date on its own, just likeText(timerInterval:), with no push or app update needed. The allowed fields are minutes only, or hours and minutes whenshowHoursis set. The sign is hidden, so countdowns and count-ups read the same way. The target date follows the same rules as the'relative'style: the end of the interval when counting down, the start when counting up. The output is localized by the system.On earlier iOS versions,
'minutes'falls back to the existing'timer'style. The schema, the generated TypeScript and Swift parameter docs, and the website'sTimerdocumentation are updated to match.Why is this useful?
Apps can show a calm, readable "Starts in 19 minutes" or "Started 12 minutes ago" in Live Activities and widgets that still updates on its own. That matches how people think about longer intervals. Before this, apps had to choose between a ticking
mm:ssclock and static text that goes stale.🤖 Generated with Claude Code