Post

Replies

Boosts

Views

Activity

Reply to Live Activity Timeline
@7_strikes The updates are not limited to Text timers, and those that are should not display seconds as the train arrivals aren't precise enough to warrant sub-minute accuracy. An "Arriving" train must be removed once it has departed (or has been scheduled to depart). Without that guarantee Live Activities are useless in this otherwise very useful situation.
1d
Reply to Live Activity Timeline
@DTS Engineer TimelineView does seem to be working. Maybe I had it configured wrong when I tried earlier or maybe I wasn't waiting long enough for an update - it seems like a cadence of about 30 seconds is the maximum refresh frequency allowed in a Live Activity. Thank you for pointing me in the right direction!
3d
Reply to Live Activity Timeline
[quote='909248022, 7_strikes, /thread/850307?answerId=909248022#909248022, /profile/7_strikes'] a push lost in a dead zone only costs staleness, and the next one corrects everything. A train that has just arrived sits at "arriving" until the next push [/quote] Unfortunately this is exactly the problem. The subway is full of dead zones and a user headed to a platform without service must not see stale trains in a perpetual "Arriving" state. As you pointed out, I will have the data locally to know when a train should have left, I just can't trigger a SwiftUI update to re-run without the app being alive in the background.
3d
Reply to Dynamic Type and Widget Layout
To answer my own question: Use ViewThatFits and build views with every possible count. Seems unnecessarily expensive but it works. var body: some View { ViewThatFits { ForEach((1...entry.toDos.count).reversed(), id: \.self) { limit in VStack(alignment: .leading, spacing: 4) { ForEach(entry.toDos.prefix(limit), id: \.self.identifier) { entry in ToDoView(checked: entry.completed, flag: entry.flag, text: entry.name) } if (limit < entry.toDos.count) { Text(String(format:NSLocalizedString("%i more...", comment: "[n] more..."), entry.toDos.count - limit)) .font(.footnote) .foregroundStyle(.secondary) .padding(.leading, 24) .padding(.top, -3) .unredacted() } } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’23
Reply to Live Activity Timeline
@DTS Engineer As @7_strikes notes it is not documented anywhere that TimelineView is supported in Live Activities, and as it's not supported in Widgets I didn't really expect it to be. I have submitted FB25214587 requesting "Support for TimelineView in Live Activities."
Replies
Boosts
Views
Activity
23h
Reply to Live Activity Timeline
@7_strikes The updates are not limited to Text timers, and those that are should not display seconds as the train arrivals aren't precise enough to warrant sub-minute accuracy. An "Arriving" train must be removed once it has departed (or has been scheduled to depart). Without that guarantee Live Activities are useless in this otherwise very useful situation.
Replies
Boosts
Views
Activity
1d
Reply to Live Activity Timeline
@DTS Engineer Here you go: [GitHub Demo] This project includes a periodic 10-second TimelineView in a Live Activity. The Live Activity's UI is never updated.
Replies
Boosts
Views
Activity
1d
Reply to Live Activity Timeline
@DTS Engineer Ugh, my mistake - it's not working. It was my app pushing updates to the Live Activity in the background while in the debugger. Once I detach the debugger and the main app suspends the updates stop. TimelineView is not working. I'll try to put together a quick demo project.
Replies
Boosts
Views
Activity
1d
Reply to Live Activity Timeline
@DTS Engineer TimelineView does seem to be working. Maybe I had it configured wrong when I tried earlier or maybe I wasn't waiting long enough for an update - it seems like a cadence of about 30 seconds is the maximum refresh frequency allowed in a Live Activity. Thank you for pointing me in the right direction!
Replies
Boosts
Views
Activity
3d
Reply to Live Activity Timeline
Thank you, @DTS Engineer, but in my testing a Live Activity did not support SwiftUI's TimelineView. I will try again with the iOS 27.2 beta and report back.
Replies
Boosts
Views
Activity
3d
Reply to Live Activity Timeline
[quote='909248022, 7_strikes, /thread/850307?answerId=909248022#909248022, /profile/7_strikes'] a push lost in a dead zone only costs staleness, and the next one corrects everything. A train that has just arrived sits at "arriving" until the next push [/quote] Unfortunately this is exactly the problem. The subway is full of dead zones and a user headed to a platform without service must not see stale trains in a perpetual "Arriving" state. As you pointed out, I will have the data locally to know when a train should have left, I just can't trigger a SwiftUI update to re-run without the app being alive in the background.
Replies
Boosts
Views
Activity
3d
Reply to Live Activities: no minute-granularity self-updating countdown text; custom DiscreteFormatStyle types fail to decode in the system renderer
I'm working on the same thing and having the same issue. During development the only solution has been registering for background location updates to keep the app alive and manually pushing new ActivityContent as needed.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
1w
Reply to Xcode 16.3 repeatedly log causing CPU leak
I have the same problem and my documentation indexing always gets stuck at about 15%. I've deleted the entire ~/Library/Developer folder with no change. • macOS 15.4 (24E248) • Xcode 16.3 (16E140) • M4 Pro (14-core) Mac mini
Replies
Boosts
Views
Activity
Apr ’25
Reply to Dynamic Type and Widget Layout
To answer my own question: Use ViewThatFits and build views with every possible count. Seems unnecessarily expensive but it works. var body: some View { ViewThatFits { ForEach((1...entry.toDos.count).reversed(), id: \.self) { limit in VStack(alignment: .leading, spacing: 4) { ForEach(entry.toDos.prefix(limit), id: \.self.identifier) { entry in ToDoView(checked: entry.completed, flag: entry.flag, text: entry.name) } if (limit < entry.toDos.count) { Text(String(format:NSLocalizedString("%i more...", comment: "[n] more..."), entry.toDos.count - limit)) .font(.footnote) .foregroundStyle(.secondary) .padding(.leading, 24) .padding(.top, -3) .unredacted() } } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’23