From c9ae52e660c5b071e64ba33896dc2cad6a71f8db Mon Sep 17 00:00:00 2001 From: Jason Morley Date: Thu, 30 Jul 2026 13:10:13 -1000 Subject: [PATCH] fix: Add a `TimelineView` to the example app --- Example/Example/Views/Cell.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Example/Example/Views/Cell.swift b/Example/Example/Views/Cell.swift index d4f57bc..bcc6518 100644 --- a/Example/Example/Views/Cell.swift +++ b/Example/Example/Views/Cell.swift @@ -34,6 +34,13 @@ struct Cell: View { } } + static let dateFormatter: DateFormatter = { + let dateFormatter = DateFormatter() + dateFormatter.dateStyle = .medium + dateFormatter.timeStyle = .long + return dateFormatter + }() + @Environment(\.isSelected) var isSelected @Environment(\.highlightState) var highlightState @Environment(\.selectionColor) var selectionColor @@ -57,6 +64,9 @@ struct Cell: View { } Text(item.count, format: .number) .font(.title) + TimelineView(.periodic(from: .now, by: 1.0)) { context in + Text(Self.dateFormatter.string(from: context.date)) + } Spacer() } .background(isPainted ? .mint : item.color.opacity(0.4))