Glad to post my first question here!
I've been playing around with SwiftUI for a few weeks now and during a bigger project, I found the following bug.
If you have a TabView and a list inside it, if you try to change the tab while the scroll animation takes place, the app will crash with FATAL ERROR: "Thread 1: signal SIGABRT".
Console:
- BugTest[11830:362796] precondition failure: attribute failed to set an initial value: 98
Have you ever encountered this? Is there any way I can solve this issue without changing my list into a ForEach?
Thank you in advance!
Code:
import SwiftUI
struct ContentView: View {
var body: some View {
TabView {
list()
.tabItem {
Image(systemName: "doc")
.font(.system(size: 25))
}
Text("Testing the bug")
.tabItem {
Image(systemName: "list.dash")
.font(.system(size: 25))
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
struct list: View {
var body: some View {
List(0..<50){_ in
Text("test")
}
}
}