Hello. I’ve encountered a strange issue with TimelineView
and wanted to report it.
The following code runs without any problems:
// Example 1.
struct ContentView: View {
var body: some View {
TimelineView(.everyMinute) { _ in
List {
TimelineView(.everyMinute) { _ in
Text("Hello")
}
}
}
}
}
However, the code below causes the CPU usage to spike to 100%, and the screen displays a blank view:
// Example 2.
struct ContentView: View {
var body: some View {
TimelineView(.everyMinute) { _ in
List {
TimelineView(.everyMinute) { _ in
text
}
}
}
}
var text: some View {
Text("Hello")
}
}
The same issue occurs with the following code:
// Example 3.
struct MyTextView: View {
var body: some View {
Text("Hello")
}
}
struct ContentView: View {
var body: some View {
TimelineView(.everyMinute) { _ in
List {
TimelineView(.everyMinute) { _ in
MyTextView()
}
}
}
}
}
Replacing List
with LazyVStack
and ForEach
resolves the hang issue, but I need to use List
because I rely on the swipeActions()
.
Does anyone have insights or suggestions on how to address this issue?